Chromium Code Reviews| Index: test/cctest/test-serialize.cc |
| diff --git a/test/cctest/test-serialize.cc b/test/cctest/test-serialize.cc |
| index 2dcfc00205964e9a4db2c5f88649d464623dccbe..c5836f69cbb504fb3df9148e83d1269a2bcb0069 100644 |
| --- a/test/cctest/test-serialize.cc |
| +++ b/test/cctest/test-serialize.cc |
| @@ -198,13 +198,15 @@ static void SanityCheck(v8::Isolate* v8_isolate) { |
| } |
| -UNINITIALIZED_DEPENDENT_TEST(Deserialize, Serialize) { |
| +UNINITIALIZED_TEST(Deserialize) { |
| // The serialize-deserialize tests only work if the VM is built without |
| // serialization. That doesn't matter. We don't need to be able to |
| // serialize a snapshot in a VM that is booted from a snapshot. |
| DisableTurbofan(); |
| if (DefaultSnapshotAvailable()) return; |
| - v8::Isolate* isolate = Deserialize(); |
| + v8::Isolate* isolate = TestIsolate::NewInitialized(true); |
| + Serialize(isolate); |
| + isolate = Deserialize(); |
| { |
| v8::HandleScope handle_scope(isolate); |
| v8::Isolate::Scope isolate_scope(isolate); |
| @@ -218,11 +220,13 @@ UNINITIALIZED_DEPENDENT_TEST(Deserialize, Serialize) { |
| } |
| -UNINITIALIZED_DEPENDENT_TEST(DeserializeFromSecondSerialization, |
| - SerializeTwice) { |
| +UNINITIALIZED_TEST(DeserializeFromSecondSerialization) { |
| DisableTurbofan(); |
| if (DefaultSnapshotAvailable()) return; |
| - v8::Isolate* isolate = Deserialize(); |
| + v8::Isolate* isolate = TestIsolate::NewInitialized(true); |
| + Serialize(isolate); |
| + Serialize(isolate); |
| + isolate = Deserialize(); |
| { |
| v8::Isolate::Scope isolate_scope(isolate); |
| v8::HandleScope handle_scope(isolate); |
| @@ -236,10 +240,12 @@ UNINITIALIZED_DEPENDENT_TEST(DeserializeFromSecondSerialization, |
| } |
| -UNINITIALIZED_DEPENDENT_TEST(DeserializeAndRunScript2, Serialize) { |
| +UNINITIALIZED_TEST(DeserializeAndRunScript2) { |
| DisableTurbofan(); |
| if (DefaultSnapshotAvailable()) return; |
| - v8::Isolate* isolate = Deserialize(); |
| + v8::Isolate* isolate = TestIsolate::NewInitialized(true); |
| + Serialize(isolate); |
|
Michael Achenbach
2016/03/02 11:22:47
FYI: The old "Serialize" test doesn't call isolate
|
| + isolate = Deserialize(); |
| { |
| v8::Isolate::Scope isolate_scope(isolate); |
| v8::HandleScope handle_scope(isolate); |
| @@ -259,11 +265,13 @@ UNINITIALIZED_DEPENDENT_TEST(DeserializeAndRunScript2, Serialize) { |
| } |
| -UNINITIALIZED_DEPENDENT_TEST(DeserializeFromSecondSerializationAndRunScript2, |
| - SerializeTwice) { |
| +UNINITIALIZED_TEST(DeserializeFromSecondSerializationAndRunScript2) { |
| DisableTurbofan(); |
| if (DefaultSnapshotAvailable()) return; |
| - v8::Isolate* isolate = Deserialize(); |
| + v8::Isolate* isolate = TestIsolate::NewInitialized(true); |
| + Serialize(isolate); |
| + Serialize(isolate); |
| + isolate = Deserialize(); |
| { |
| v8::Isolate::Scope isolate_scope(isolate); |
| v8::HandleScope handle_scope(isolate); |
| @@ -281,10 +289,7 @@ UNINITIALIZED_DEPENDENT_TEST(DeserializeFromSecondSerializationAndRunScript2, |
| isolate->Dispose(); |
| } |
| - |
| -UNINITIALIZED_TEST(PartialSerialization) { |
| - DisableTurbofan(); |
| - if (DefaultSnapshotAvailable()) return; |
| +static void PartiallySerialize() { |
| v8::Isolate* v8_isolate = TestIsolate::NewInitialized(true); |
| Isolate* isolate = reinterpret_cast<Isolate*>(v8_isolate); |
| v8_isolate->Enter(); |
| @@ -353,9 +358,17 @@ UNINITIALIZED_TEST(PartialSerialization) { |
| } |
| -UNINITIALIZED_DEPENDENT_TEST(PartialDeserialization, PartialSerialization) { |
| +UNINITIALIZED_TEST(PartialSerialization) { |
| DisableTurbofan(); |
| if (DefaultSnapshotAvailable()) return; |
| + PartiallySerialize(); |
|
Michael Achenbach
2016/03/02 11:22:47
For all serialize/deserialize pairs: Do we want th
|
| +} |
| + |
| + |
| +UNINITIALIZED_TEST(PartialDeserialization) { |
| + DisableTurbofan(); |
| + if (DefaultSnapshotAvailable()) return; |
| + PartiallySerialize(); |
| int file_name_length = StrLength(FLAG_testing_serialization_file) + 10; |
| Vector<char> startup_name = Vector<char>::New(file_name_length + 1); |
| SNPrintF(startup_name, "%s.startup", FLAG_testing_serialization_file); |
| @@ -400,10 +413,7 @@ UNINITIALIZED_DEPENDENT_TEST(PartialDeserialization, PartialSerialization) { |
| v8_isolate->Dispose(); |
| } |
| - |
| -UNINITIALIZED_TEST(ContextSerialization) { |
| - DisableTurbofan(); |
| - if (DefaultSnapshotAvailable()) return; |
| +static void SerializeContext() { |
| v8::Isolate* v8_isolate = TestIsolate::NewInitialized(true); |
| Isolate* isolate = reinterpret_cast<Isolate*>(v8_isolate); |
| Heap* heap = isolate->heap(); |
| @@ -466,9 +476,17 @@ UNINITIALIZED_TEST(ContextSerialization) { |
| } |
| -UNINITIALIZED_DEPENDENT_TEST(ContextDeserialization, ContextSerialization) { |
| +UNINITIALIZED_TEST(ContextSerialization) { |
| DisableTurbofan(); |
| if (DefaultSnapshotAvailable()) return; |
| + SerializeContext(); |
| +} |
| + |
| + |
| +UNINITIALIZED_TEST(ContextDeserialization) { |
| + DisableTurbofan(); |
| + if (DefaultSnapshotAvailable()) return; |
| + SerializeContext(); |
| int file_name_length = StrLength(FLAG_testing_serialization_file) + 10; |
| Vector<char> startup_name = Vector<char>::New(file_name_length + 1); |
| SNPrintF(startup_name, "%s.startup", FLAG_testing_serialization_file); |
| @@ -513,9 +531,7 @@ UNINITIALIZED_DEPENDENT_TEST(ContextDeserialization, ContextSerialization) { |
| } |
| -UNINITIALIZED_TEST(CustomContextSerialization) { |
| - DisableTurbofan(); |
| - if (DefaultSnapshotAvailable()) return; |
| +static void SerializeCustomContext() { |
| v8::Isolate* v8_isolate = TestIsolate::NewInitialized(true); |
| Isolate* isolate = reinterpret_cast<Isolate*>(v8_isolate); |
| { |
| @@ -597,11 +613,19 @@ UNINITIALIZED_TEST(CustomContextSerialization) { |
| } |
| -UNINITIALIZED_DEPENDENT_TEST(CustomContextDeserialization, |
| - CustomContextSerialization) { |
| + |
| +UNINITIALIZED_TEST(CustomContextSerialization) { |
| + DisableTurbofan(); |
| + if (DefaultSnapshotAvailable()) return; |
| + SerializeCustomContext(); |
| +} |
| + |
| + |
| +UNINITIALIZED_TEST(CustomContextDeserialization) { |
| DisableTurbofan(); |
| FLAG_crankshaft = false; |
| if (DefaultSnapshotAvailable()) return; |
| + SerializeCustomContext(); |
| int file_name_length = StrLength(FLAG_testing_serialization_file) + 10; |
| Vector<char> startup_name = Vector<char>::New(file_name_length + 1); |
| SNPrintF(startup_name, "%s.startup", FLAG_testing_serialization_file); |
| @@ -869,12 +893,6 @@ TEST(TestThatAlwaysFails) { |
| } |
| -DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { |
| - bool ArtificialFailure2 = false; |
| - CHECK(ArtificialFailure2); |
| -} |
| - |
| - |
| int CountBuiltins() { |
| // Check that we have not deserialized any additional builtin. |
| HeapIterator iterator(CcTest::heap()); |