Commit 878963a8 authored by Dan Carney's avatar Dan Carney

split interceptor tests off of test-api

BUG=
R=verwaest@chromium.org

Review URL: https://codereview.chromium.org/900033003

Cr-Commit-Position: refs/heads/master@{#26484}
parent 158a8765
......@@ -98,6 +98,8 @@
'test-accessors.cc',
'test-alloc.cc',
'test-api.cc',
'test-api.h',
'test-api-interceptors.cc',
'test-ast.cc',
'test-atomicops.cc',
'test-bignum.cc',
......
......@@ -143,6 +143,7 @@
# Pass but take too long with the simulator.
'test-api/ExternalArrays': [PASS, TIMEOUT],
'test-api/Threading1': [SKIP],
'test-api/Threading2': [SKIP],
}], # 'arch == arm64 and simulator_run == True'
['arch == arm64 and mode == debug and simulator_run == True', {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/v8.h"
#include "src/cpu-profiler.h"
#include "src/isolate.h"
#include "src/vm-state.h"
#include "test/cctest/cctest.h"
template <typename T>
static void CheckReturnValue(const T& t, i::Address callback) {
v8::ReturnValue<v8::Value> rv = t.GetReturnValue();
i::Object** o = *reinterpret_cast<i::Object***>(&rv);
CHECK_EQ(CcTest::isolate(), t.GetIsolate());
CHECK_EQ(t.GetIsolate(), rv.GetIsolate());
CHECK((*o)->IsTheHole() || (*o)->IsUndefined());
// Verify reset
bool is_runtime = (*o)->IsTheHole();
rv.Set(true);
CHECK(!(*o)->IsTheHole() && !(*o)->IsUndefined());
rv.Set(v8::Handle<v8::Object>());
CHECK((*o)->IsTheHole() || (*o)->IsUndefined());
CHECK_EQ(is_runtime, (*o)->IsTheHole());
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(t.GetIsolate());
// If CPU profiler is active check that when API callback is invoked
// VMState is set to EXTERNAL.
if (isolate->cpu_profiler()->is_profiling()) {
CHECK_EQ(v8::EXTERNAL, isolate->current_vm_state());
CHECK(isolate->external_callback_scope());
CHECK_EQ(callback, isolate->external_callback_scope()->callback());
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment