Index: test/cctest/test-serialize.cc |
diff --git a/test/cctest/test-serialize.cc b/test/cctest/test-serialize.cc |
index 592a9ff1192c35ff0d6cc186619b6e9868e7fc06..3a2d6f26d97db3356a207bf98db69a20b072696d 100644 |
--- a/test/cctest/test-serialize.cc |
+++ b/test/cctest/test-serialize.cc |
@@ -748,6 +748,42 @@ TEST(PerIsolateSnapshotBlobs) { |
} |
+TEST(PerIsolateSnapshotBlobsWithLocker) { |
+ // Disable experimental natives that are loaded after deserialization. |
+ FLAG_harmony_shipping = false; |
+ FlagList::EnforceFlagImplications(); |
+ |
+ v8::Isolate* isolate0 = v8::Isolate::New(); |
+ { |
+ v8::Locker locker(isolate0); |
+ v8::Isolate::Scope i_scope(isolate0); |
+ v8::HandleScope h_scope(isolate0); |
+ v8::Local<v8::Context> context = v8::Context::New(isolate0); |
+ v8::Context::Scope c_scope(context); |
+ CHECK_EQ(1, CompileRun("Math.cos(0)")->ToInt32(isolate0)->Int32Value()); |
+ } |
+ isolate0->Dispose(); |
+ |
+ const char* source1 = "function f() { return 42; }"; |
+ |
+ v8::StartupData data1 = v8::V8::CreateSnapshotDataBlob(source1); |
+ |
+ v8::Isolate::CreateParams params1; |
+ params1.snapshot_blob = &data1; |
+ v8::Isolate* isolate1 = v8::Isolate::New(params1); |
+ { |
+ v8::Locker locker(isolate1); |
+ v8::Isolate::Scope i_scope(isolate1); |
+ v8::HandleScope h_scope(isolate1); |
+ v8::Local<v8::Context> context = v8::Context::New(isolate1); |
+ delete[] data1.data; // We can dispose of the snapshot blob now. |
+ v8::Context::Scope c_scope(context); |
+ CHECK_EQ(42, CompileRun("f()")->ToInt32(isolate1)->Int32Value()); |
+ } |
+ isolate1->Dispose(); |
+} |
+ |
+ |
TEST(TestThatAlwaysSucceeds) { |
} |