summaryrefslogtreecommitdiff
path: root/test/cctest
diff options
context:
space:
mode:
Diffstat (limited to 'test/cctest')
-rw-r--r--test/cctest/node_test_fixture.h4
-rw-r--r--test/cctest/test_environment.cc14
2 files changed, 11 insertions, 7 deletions
diff --git a/test/cctest/node_test_fixture.h b/test/cctest/node_test_fixture.h
index 263f7b96f9..890fe90499 100644
--- a/test/cctest/node_test_fixture.h
+++ b/test/cctest/node_test_fixture.h
@@ -73,6 +73,8 @@ class NodeTestFixture : public ::testing::Test {
public:
static uv_loop_t* CurrentLoop() { return &current_loop; }
+ node::MultiIsolatePlatform* Platform() const { return platform_; }
+
protected:
v8::Isolate::CreateParams params_;
ArrayBufferAllocator allocator_;
@@ -84,7 +86,7 @@ class NodeTestFixture : public ::testing::Test {
virtual void SetUp() {
CHECK_EQ(0, uv_loop_init(&current_loop));
- platform_ = new node::NodePlatform(8, &current_loop, nullptr);
+ platform_ = new node::NodePlatform(8, nullptr);
v8::V8::InitializePlatform(platform_);
v8::V8::Initialize();
params_.array_buffer_allocator = &allocator_;
diff --git a/test/cctest/test_environment.cc b/test/cctest/test_environment.cc
index 8beacfa95e..704efd7a88 100644
--- a/test/cctest/test_environment.cc
+++ b/test/cctest/test_environment.cc
@@ -26,11 +26,13 @@ class EnvironmentTest : public NodeTestFixture {
public:
Env(const v8::HandleScope& handle_scope,
v8::Isolate* isolate,
- const Argv& argv) {
+ const Argv& argv,
+ NodeTestFixture* test_fixture) {
context_ = v8::Context::New(isolate);
CHECK(!context_.IsEmpty());
isolate_data_ = CreateIsolateData(isolate,
- NodeTestFixture::CurrentLoop());
+ NodeTestFixture::CurrentLoop(),
+ test_fixture->Platform());
CHECK_NE(nullptr, isolate_data_);
environment_ = CreateEnvironment(isolate_data_,
context_,
@@ -66,7 +68,7 @@ class EnvironmentTest : public NodeTestFixture {
TEST_F(EnvironmentTest, AtExitWithEnvironment) {
const v8::HandleScope handle_scope(isolate_);
const Argv argv;
- Env env {handle_scope, isolate_, argv};
+ Env env {handle_scope, isolate_, argv, this};
AtExit(*env, at_exit_callback1);
RunAtExit(*env);
@@ -76,7 +78,7 @@ TEST_F(EnvironmentTest, AtExitWithEnvironment) {
TEST_F(EnvironmentTest, AtExitWithArgument) {
const v8::HandleScope handle_scope(isolate_);
const Argv argv;
- Env env {handle_scope, isolate_, argv};
+ Env env {handle_scope, isolate_, argv, this};
std::string arg{"some args"};
AtExit(*env, at_exit_callback1, static_cast<void*>(&arg));
@@ -87,8 +89,8 @@ TEST_F(EnvironmentTest, AtExitWithArgument) {
TEST_F(EnvironmentTest, MultipleEnvironmentsPerIsolate) {
const v8::HandleScope handle_scope(isolate_);
const Argv argv;
- Env env1 {handle_scope, isolate_, argv};
- Env env2 {handle_scope, isolate_, argv};
+ Env env1 {handle_scope, isolate_, argv, this};
+ Env env2 {handle_scope, isolate_, argv, this};
AtExit(*env1, at_exit_callback1);
AtExit(*env2, at_exit_callback2);