Index: test/cctest/test-serialize.cc |
diff --git a/test/cctest/test-serialize.cc b/test/cctest/test-serialize.cc |
index e73e426c4d00782b99bb414a4a0a345969312738..6697252b3e1590d1064fd94c5cd79cd389efc964 100644 |
--- a/test/cctest/test-serialize.cc |
+++ b/test/cctest/test-serialize.cc |
@@ -1162,6 +1162,17 @@ TEST(SerializeToplevelExternalScriptName) { |
} |
+static bool toplevel_test_code_event_found = false; |
+ |
+ |
+static void SerializerCodeEventListener(const v8::JitCodeEvent* event) { |
+ if (event->type == v8::JitCodeEvent::CODE_ADDED && |
+ memcmp(event->name.str, "Script:~test", 12) == 0) { |
+ toplevel_test_code_event_found = true; |
+ } |
+} |
+ |
+ |
TEST(SerializeToplevelIsolates) { |
FLAG_serialize_toplevel = true; |
@@ -1194,6 +1205,9 @@ TEST(SerializeToplevelIsolates) { |
isolate1->Dispose(); |
v8::Isolate* isolate2 = v8::Isolate::New(); |
+ isolate2->SetJitCodeEventHandler(v8::kJitCodeEventDefault, |
+ SerializerCodeEventListener); |
+ toplevel_test_code_event_found = false; |
{ |
v8::Isolate::Scope iscope(isolate2); |
v8::HandleScope scope(isolate2); |
@@ -1212,6 +1226,7 @@ TEST(SerializeToplevelIsolates) { |
v8::Local<v8::Value> result = script->BindToCurrentContext()->Run(); |
CHECK(result->ToString()->Equals(v8_str("abcdef"))); |
} |
+ DCHECK(toplevel_test_code_event_found); |
isolate2->Dispose(); |
} |