-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: make cctest fixture use node::NewIsolate #21419
Conversation
node-test-commit-aix failure looks unrelated03:24:59 Node.js major version: -1
03:24:59 Node.js version: null
03:24:59 Running nodes
03:24:59 Triggering node-test-commit-aix » aix61-ppc64
03:55:03 Completed node-test-commit-aix » aix61-ppc64 FAILURE
03:55:03 All downstream projects complete!
03:55:03 Notifying upstream projects of job completion
03:55:03 Finished: FAILURE |
test/cctest/node_test_fixture.h
Outdated
@@ -85,7 +86,9 @@ class NodeTestFixture : public ::testing::Test { | |||
} | |||
|
|||
virtual void SetUp() { | |||
isolate_ = v8::Isolate::New(params); | |||
allocator.reset(node::CreateArrayBufferAllocator()); | |||
allocator.get_deleter() = &node::FreeArrayBufferAllocator; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks mildly questionable. Why not e.g.:
allocator = ArrayBufferUniquePtr(node::CreateArrayBufferAllocator(), &node::FreeArrayBufferAllocator);
(Might need a std::move()
.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used reset
mainly to follow the pattern of the other unique_ptr's in that file but this would be much cleaner. I'll update shortly. Thanks
This commit updates the gtest fixture to use node::NewIsolate instead of creating a new V8 Isolate using v8::Isolate::New. The motivation for this is that without calling node::NewIsolate the various callbacks set on the isolate, for example AddMessageListener, SetFatalErrorHandler etc, would not get set. I don't think this is the expected behaviour and I ran into this when writing a new cctest.
934e969
to
1edab2d
Compare
This commit updates the gtest fixture to use node::NewIsolate instead of creating a new V8 Isolate using v8::Isolate::New. The motivation for this is that without calling node::NewIsolate the various callbacks set on the isolate, for example AddMessageListener, SetFatalErrorHandler etc, would not get set. I don't think this is the expected behaviour and I ran into this when writing a new cctest. PR-URL: #21419 Reviewed-By: Ben Noordhuis <[email protected]>
PR-URL: #21419 Reviewed-By: Ben Noordhuis <[email protected]>
This commit updates the gtest fixture to use node::NewIsolate instead of creating a new V8 Isolate using v8::Isolate::New. The motivation for this is that without calling node::NewIsolate the various callbacks set on the isolate, for example AddMessageListener, SetFatalErrorHandler etc, would not get set. I don't think this is the expected behaviour and I ran into this when writing a new cctest. PR-URL: #21419 Reviewed-By: Ben Noordhuis <[email protected]>
PR-URL: #21419 Reviewed-By: Ben Noordhuis <[email protected]>
This commit updates the gtest fixture to use node::NewIsolate instead of
creating a new V8 Isolate using v8::Isolate::New.
The motivation for this is that without calling node::NewIsolate the
various callbacks set on the isolate, for example AddMessageListener,
SetFatalErrorHandler etc, would not get set. I don't think this is the
expected behaviour and I ran into this when writing a new cctest.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes