diff options
author | Daniel Bevenius <daniel.bevenius@gmail.com> | 2018-07-03 09:37:07 +0200 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2018-09-07 21:07:29 +0200 |
commit | 90ae4bd0c987479ff364a469e6f2fcc83baba66c (patch) | |
tree | fdbc96f5b8a8aa53e240515a2f7d3f1f6e242fd6 /test/cctest | |
parent | d5e72944457117913c7ded2caf1f623a25f8726f (diff) | |
download | android-node-v8-90ae4bd0c987479ff364a469e6f2fcc83baba66c.tar.gz android-node-v8-90ae4bd0c987479ff364a469e6f2fcc83baba66c.tar.bz2 android-node-v8-90ae4bd0c987479ff364a469e6f2fcc83baba66c.zip |
src: add InitializeV8Platform function
This commit adds an InitializeV8Platform function which calls
v8_platform's Initialize to create the NodePlatform and also set the
structs members.
When running cctests this functions was not being called (it is called
from the Start function but that function is not called by the test
fixture.
The motivation for adding this is that I'm guessing that embedders
would might need the ability to do the same thing.
Refs: https://github.com/nodejs/node-v8/issues/69
PR-URL: https://github.com/nodejs/node/pull/21983
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'test/cctest')
-rw-r--r-- | test/cctest/node_test_fixture.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/test/cctest/node_test_fixture.h b/test/cctest/node_test_fixture.h index 4a729be09c..775a211f54 100644 --- a/test/cctest/node_test_fixture.h +++ b/test/cctest/node_test_fixture.h @@ -70,9 +70,9 @@ class NodeTestFixture : public ::testing::Test { tracing_controller.reset(new v8::TracingController()); node::tracing::TraceEventHelper::SetTracingController( tracing_controller.get()); - platform.reset(new node::NodePlatform(4, nullptr)); CHECK_EQ(0, uv_loop_init(¤t_loop)); - v8::V8::InitializePlatform(platform.get()); + platform.reset(static_cast<node::NodePlatform*>( + node::InitializeV8Platform(4))); v8::V8::Initialize(); } @@ -88,10 +88,8 @@ class NodeTestFixture : public ::testing::Test { virtual void SetUp() { allocator = ArrayBufferUniquePtr(node::CreateArrayBufferAllocator(), &node::FreeArrayBufferAllocator); - isolate_ = NewIsolate(allocator.get()); + isolate_ = NewIsolate(allocator.get(), ¤t_loop); CHECK_NE(isolate_, nullptr); - platform->RegisterIsolate(isolate_, ¤t_loop); - v8::Isolate::Initialize(isolate_, params); } virtual void TearDown() { |