| 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 | 279 |
| 280 //---------------------------------------------------------------------------- | 280 //---------------------------------------------------------------------------- |
| 281 // Tests that the heap can be deserialized. | 281 // Tests that the heap can be deserialized. |
| 282 | 282 |
| 283 static void Deserialize() { | 283 static void Deserialize() { |
| 284 CHECK(Snapshot::Initialize(FLAG_testing_serialization_file)); | 284 CHECK(Snapshot::Initialize(FLAG_testing_serialization_file)); |
| 285 } | 285 } |
| 286 | 286 |
| 287 | 287 |
| 288 static void SanityCheck() { | 288 static void SanityCheck() { |
| 289 Isolate* isolate = Isolate::Current(); |
| 289 v8::HandleScope scope(v8::Isolate::GetCurrent()); | 290 v8::HandleScope scope(v8::Isolate::GetCurrent()); |
| 290 #ifdef VERIFY_HEAP | 291 #ifdef VERIFY_HEAP |
| 291 HEAP->Verify(); | 292 HEAP->Verify(); |
| 292 #endif | 293 #endif |
| 293 CHECK(Isolate::Current()->global_object()->IsJSObject()); | 294 CHECK(isolate->global_object()->IsJSObject()); |
| 294 CHECK(Isolate::Current()->native_context()->IsContext()); | 295 CHECK(isolate->native_context()->IsContext()); |
| 295 CHECK(HEAP->string_table()->IsStringTable()); | 296 CHECK(HEAP->string_table()->IsStringTable()); |
| 296 CHECK(!FACTORY->InternalizeOneByteString( | 297 CHECK(!isolate->factory()->InternalizeOneByteString( |
| 297 STATIC_ASCII_VECTOR("Empty"))->IsFailure()); | 298 STATIC_ASCII_VECTOR("Empty"))->IsFailure()); |
| 298 } | 299 } |
| 299 | 300 |
| 300 | 301 |
| 301 DEPENDENT_TEST(Deserialize, Serialize) { | 302 DEPENDENT_TEST(Deserialize, Serialize) { |
| 302 // The serialize-deserialize tests only work if the VM is built without | 303 // The serialize-deserialize tests only work if the VM is built without |
| 303 // serialization. That doesn't matter. We don't need to be able to | 304 // serialization. That doesn't matter. We don't need to be able to |
| 304 // serialize a snapshot in a VM that is booted from a snapshot. | 305 // serialize a snapshot in a VM that is booted from a snapshot. |
| 305 if (!Snapshot::HaveASnapshotToStartFrom()) { | 306 if (!Snapshot::HaveASnapshotToStartFrom()) { |
| 306 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 307 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 TEST(TestThatAlwaysFails) { | 626 TEST(TestThatAlwaysFails) { |
| 626 bool ArtificialFailure = false; | 627 bool ArtificialFailure = false; |
| 627 CHECK(ArtificialFailure); | 628 CHECK(ArtificialFailure); |
| 628 } | 629 } |
| 629 | 630 |
| 630 | 631 |
| 631 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { | 632 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { |
| 632 bool ArtificialFailure2 = false; | 633 bool ArtificialFailure2 = false; |
| 633 CHECK(ArtificialFailure2); | 634 CHECK(ArtificialFailure2); |
| 634 } | 635 } |
| OLD | NEW |