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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 WriteToFile(reinterpret_cast<Isolate*>(isolate), |
260 FLAG_testing_serialization_file); | 260 FLAG_testing_serialization_file); |
261 } | 261 } |
262 | 262 |
263 | 263 |
264 // Test that the whole heap can be serialized. | 264 // Test that the whole heap can be serialized. |
265 TEST(Serialize) { | 265 UNINITIALIZED_TEST(Serialize) { |
266 if (!Snapshot::HaveASnapshotToStartFrom()) { | 266 if (!Snapshot::HaveASnapshotToStartFrom()) { |
267 Serializer::Enable(Isolate::Current()); | 267 Serializer::Enable(Isolate::Current()); |
268 v8::V8::Initialize(); | 268 v8::V8::Initialize(); |
269 Serialize(); | 269 Serialize(); |
270 } | 270 } |
271 } | 271 } |
272 | 272 |
273 | 273 |
274 // Test that heap serialization is non-destructive. | 274 // Test that heap serialization is non-destructive. |
275 TEST(SerializeTwice) { | 275 UNINITIALIZED_TEST(SerializeTwice) { |
276 if (!Snapshot::HaveASnapshotToStartFrom()) { | 276 if (!Snapshot::HaveASnapshotToStartFrom()) { |
277 Serializer::Enable(Isolate::Current()); | 277 Serializer::Enable(Isolate::Current()); |
278 v8::V8::Initialize(); | 278 v8::V8::Initialize(); |
279 Serialize(); | 279 Serialize(); |
280 Serialize(); | 280 Serialize(); |
281 } | 281 } |
282 } | 282 } |
283 | 283 |
284 | 284 |
285 //---------------------------------------------------------------------------- | 285 //---------------------------------------------------------------------------- |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 env->Enter(); | 363 env->Enter(); |
364 | 364 |
365 const char* c_source = "\"1234\".length"; | 365 const char* c_source = "\"1234\".length"; |
366 v8::Local<v8::String> source = v8::String::New(c_source); | 366 v8::Local<v8::String> source = v8::String::New(c_source); |
367 v8::Local<v8::Script> script = v8::Script::Compile(source); | 367 v8::Local<v8::Script> script = v8::Script::Compile(source); |
368 CHECK_EQ(4, script->Run()->Int32Value()); | 368 CHECK_EQ(4, script->Run()->Int32Value()); |
369 } | 369 } |
370 } | 370 } |
371 | 371 |
372 | 372 |
373 TEST(PartialSerialization) { | 373 UNINITIALIZED_TEST(PartialSerialization) { |
374 if (!Snapshot::HaveASnapshotToStartFrom()) { | 374 if (!Snapshot::HaveASnapshotToStartFrom()) { |
375 Isolate* isolate = Isolate::Current(); | 375 Isolate* isolate = Isolate::Current(); |
376 Serializer::Enable(isolate); | 376 Serializer::Enable(isolate); |
377 v8::V8::Initialize(); | 377 v8::V8::Initialize(); |
378 v8::Isolate* v8_isolate = reinterpret_cast<v8::Isolate*>(isolate); | 378 v8::Isolate* v8_isolate = reinterpret_cast<v8::Isolate*>(isolate); |
379 Heap* heap = isolate->heap(); | 379 Heap* heap = isolate->heap(); |
380 | 380 |
381 v8::Persistent<v8::Context> env; | 381 v8::Persistent<v8::Context> env; |
382 { | 382 { |
383 HandleScope scope(isolate); | 383 HandleScope scope(isolate); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 Deserializer deserializer(&source); | 514 Deserializer deserializer(&source); |
515 ReserveSpaceForSnapshot(&deserializer, file_name); | 515 ReserveSpaceForSnapshot(&deserializer, file_name); |
516 deserializer.DeserializePartial(isolate, &root2); | 516 deserializer.DeserializePartial(isolate, &root2); |
517 CHECK(root2->IsString()); | 517 CHECK(root2->IsString()); |
518 CHECK(*root_handle == root2); | 518 CHECK(*root_handle == root2); |
519 } | 519 } |
520 } | 520 } |
521 } | 521 } |
522 | 522 |
523 | 523 |
524 TEST(ContextSerialization) { | 524 UNINITIALIZED_TEST(ContextSerialization) { |
525 if (!Snapshot::HaveASnapshotToStartFrom()) { | 525 if (!Snapshot::HaveASnapshotToStartFrom()) { |
526 Isolate* isolate = Isolate::Current(); | 526 Isolate* isolate = Isolate::Current(); |
527 Serializer::Enable(isolate); | 527 Serializer::Enable(isolate); |
528 v8::V8::Initialize(); | 528 v8::V8::Initialize(); |
529 v8::Isolate* v8_isolate = reinterpret_cast<v8::Isolate*>(isolate); | 529 v8::Isolate* v8_isolate = reinterpret_cast<v8::Isolate*>(isolate); |
530 Heap* heap = isolate->heap(); | 530 Heap* heap = isolate->heap(); |
531 | 531 |
532 v8::Persistent<v8::Context> env; | 532 v8::Persistent<v8::Context> env; |
533 { | 533 { |
534 HandleScope scope(isolate); | 534 HandleScope scope(isolate); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 TEST(TestThatAlwaysFails) { | 640 TEST(TestThatAlwaysFails) { |
641 bool ArtificialFailure = false; | 641 bool ArtificialFailure = false; |
642 CHECK(ArtificialFailure); | 642 CHECK(ArtificialFailure); |
643 } | 643 } |
644 | 644 |
645 | 645 |
646 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { | 646 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { |
647 bool ArtificialFailure2 = false; | 647 bool ArtificialFailure2 = false; |
648 CHECK(ArtificialFailure2); | 648 CHECK(ArtificialFailure2); |
649 } | 649 } |
OLD | NEW |