OLD | NEW |
1 // Copyright 2007-2010 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 static void Serialize() { | 249 static void Serialize() { |
250 // We have to create one context. One reason for this is so that the builtins | 250 // We have to create one context. One reason for this is so that the builtins |
251 // can be loaded from v8natives.js and their addresses can be processed. This | 251 // can be loaded from v8natives.js and their addresses can be processed. This |
252 // will clear the pending fixups array, which would otherwise contain GC roots | 252 // will clear the pending fixups array, which would otherwise contain GC roots |
253 // that would confuse the serialization/deserialization process. | 253 // that would confuse the serialization/deserialization process. |
254 v8::Isolate* isolate = CcTest::isolate(); | 254 v8::Isolate* isolate = CcTest::isolate(); |
255 { | 255 { |
256 v8::HandleScope scope(isolate); | 256 v8::HandleScope scope(isolate); |
257 v8::Context::New(isolate); | 257 v8::Context::New(isolate); |
258 } | 258 } |
259 WriteToFile(reinterpret_cast<Isolate*>(isolate), | 259 |
260 FLAG_testing_serialization_file); | 260 Isolate* internal_isolate = CcTest::i_isolate(); |
| 261 internal_isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, "serialize"); |
| 262 WriteToFile(internal_isolate, FLAG_testing_serialization_file); |
261 } | 263 } |
262 | 264 |
263 | 265 |
264 // Test that the whole heap can be serialized. | 266 // Test that the whole heap can be serialized. |
265 UNINITIALIZED_TEST(Serialize) { | 267 UNINITIALIZED_TEST(Serialize) { |
266 if (!Snapshot::HaveASnapshotToStartFrom()) { | 268 if (!Snapshot::HaveASnapshotToStartFrom()) { |
267 Serializer::Enable(CcTest::i_isolate()); | 269 Serializer::Enable(CcTest::i_isolate()); |
268 v8::V8::Initialize(); | 270 v8::V8::Initialize(); |
269 Serialize(); | 271 Serialize(); |
270 } | 272 } |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 TEST(TestThatAlwaysFails) { | 642 TEST(TestThatAlwaysFails) { |
641 bool ArtificialFailure = false; | 643 bool ArtificialFailure = false; |
642 CHECK(ArtificialFailure); | 644 CHECK(ArtificialFailure); |
643 } | 645 } |
644 | 646 |
645 | 647 |
646 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { | 648 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { |
647 bool ArtificialFailure2 = false; | 649 bool ArtificialFailure2 = false; |
648 CHECK(ArtificialFailure2); | 650 CHECK(ArtificialFailure2); |
649 } | 651 } |
OLD | NEW |