OLD | NEW |
1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2008 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 // We have to create one context. One reason for this is so that the builtins | 190 // We have to create one context. One reason for this is so that the builtins |
191 // can be loaded from v8natives.js and their addresses can be processed. This | 191 // can be loaded from v8natives.js and their addresses can be processed. This |
192 // will clear the pending fixups array, which would otherwise contain GC roots | 192 // will clear the pending fixups array, which would otherwise contain GC roots |
193 // that would confuse the serialization/deserialization process. | 193 // that would confuse the serialization/deserialization process. |
194 v8::Persistent<v8::Context> env = v8::Context::New(); | 194 v8::Persistent<v8::Context> env = v8::Context::New(); |
195 env.Dispose(); | 195 env.Dispose(); |
196 Snapshot::WriteToFile2(FLAG_testing_serialization_file); | 196 Snapshot::WriteToFile2(FLAG_testing_serialization_file); |
197 } | 197 } |
198 | 198 |
199 | 199 |
200 // Test that the whole heap can be serialized when running from the | |
201 // internal snapshot. | |
202 // (Smoke test.) | |
203 TEST(SerializeInternal) { | |
204 Snapshot::Initialize(NULL); | |
205 Serialize(); | |
206 } | |
207 | |
208 | |
209 // Test that the whole heap can be serialized when running from a | 200 // Test that the whole heap can be serialized when running from a |
210 // bootstrapped heap. | 201 // bootstrapped heap. |
211 // (Smoke test.) | 202 // (Smoke test.) |
212 TEST(Serialize) { | 203 TEST(Serialize) { |
213 if (Snapshot::IsEnabled()) return; | 204 if (Snapshot::IsEnabled()) return; |
214 Serialize(); | 205 Serialize(); |
215 } | 206 } |
216 | 207 |
217 | 208 |
218 // Test that the whole heap can be serialized. | 209 // Test that the whole heap can be serialized. |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 TEST(TestThatAlwaysFails) { | 340 TEST(TestThatAlwaysFails) { |
350 bool ArtificialFailure = false; | 341 bool ArtificialFailure = false; |
351 CHECK(ArtificialFailure); | 342 CHECK(ArtificialFailure); |
352 } | 343 } |
353 | 344 |
354 | 345 |
355 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { | 346 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { |
356 bool ArtificialFailure2 = false; | 347 bool ArtificialFailure2 = false; |
357 CHECK(ArtificialFailure2); | 348 CHECK(ArtificialFailure2); |
358 } | 349 } |
OLD | NEW |