diff options
author | Anna Henningsen <anna@addaleax.net> | 2017-09-14 13:05:48 +0200 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2017-11-12 14:01:54 +0100 |
commit | c7ad729072186594521f5d1033ebb101bfdd36f7 (patch) | |
tree | 6c426b5f31eaf70fef48e41f7b87859cee16f0e5 /test/cctest/test_environment.cc | |
parent | a645d45dd500f5b73efb1e940ffafadcf61f3628 (diff) | |
download | android-node-v8-c7ad729072186594521f5d1033ebb101bfdd36f7.tar.gz android-node-v8-c7ad729072186594521f5d1033ebb101bfdd36f7.tar.bz2 android-node-v8-c7ad729072186594521f5d1033ebb101bfdd36f7.zip |
src: prepare v8 platform for multi-isolate support
This splits the task queue used for asynchronous tasks scheduled
by V8 in per-isolate queues, so that multiple threads can be supported.
Original-PR-URL: https://github.com/ayojs/ayo/pull/89
Original-Reviewed-By: Timothy Gu <timothygu99@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/16700
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/cctest/test_environment.cc')
-rw-r--r-- | test/cctest/test_environment.cc | 14 |
1 files changed, 8 insertions, 6 deletions
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); |