Skip to content

Commit a1ecc28

Browse files
committed
test: use v8::Locker to lock isolates properly in cctest
1 parent fa3d23b commit a1ecc28

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

test/cctest/test_environment.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ TEST_F(EnvironmentTest, InspectorMultipleEmbeddedEnvironments) {
438438
// This test sets a global variable in the child Environment, and reads it
439439
// back both through the inspector and inside the child Environment, and
440440
// makes sure that those correspond to the value that was originally set.
441+
v8::Locker locker(isolate_);
441442
const v8::HandleScope handle_scope(isolate_);
442443
const Argv argv;
443444
Env env {handle_scope, argv};
@@ -507,6 +508,7 @@ TEST_F(EnvironmentTest, InspectorMultipleEmbeddedEnvironments) {
507508
CHECK_NOT_NULL(isolate);
508509

509510
{
511+
v8::Locker locker(isolate);
510512
v8::Isolate::Scope isolate_scope(isolate);
511513
v8::HandleScope handle_scope(isolate);
512514

@@ -630,6 +632,7 @@ TEST_F(NodeZeroIsolateTestFixture, CtrlCWithOnlySafeTerminationTest) {
630632

631633
// Try creating Context + IsolateData + Environment.
632634
{
635+
v8::Locker locker(isolate);
633636
v8::Isolate::Scope isolate_scope(isolate);
634637
v8::HandleScope handle_scope(isolate);
635638

test/cctest/test_platform.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ TEST_F(NodeZeroIsolateTestFixture, IsolatePlatformDelegateTest) {
7878

7979
// Try creating Context + IsolateData + Environment
8080
{
81+
v8::Locker locker(isolate);
8182
v8::Isolate::Scope isolate_scope(isolate);
8283
v8::HandleScope handle_scope(isolate);
8384

0 commit comments

Comments
 (0)