| 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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 | 358 |
| 359 v8::Persistent<v8::Context> env = v8::Context::New(); | 359 v8::Persistent<v8::Context> env = v8::Context::New(); |
| 360 ASSERT(!env.IsEmpty()); | 360 ASSERT(!env.IsEmpty()); |
| 361 env->Enter(); | 361 env->Enter(); |
| 362 // Make sure all builtin scripts are cached. | 362 // Make sure all builtin scripts are cached. |
| 363 { HandleScope scope; | 363 { HandleScope scope; |
| 364 for (int i = 0; i < Natives::GetBuiltinsCount(); i++) { | 364 for (int i = 0; i < Natives::GetBuiltinsCount(); i++) { |
| 365 Isolate::Current()->bootstrapper()->NativesSourceLookup(i); | 365 Isolate::Current()->bootstrapper()->NativesSourceLookup(i); |
| 366 } | 366 } |
| 367 } | 367 } |
| 368 HEAP->CollectAllGarbage(Heap::kForceCompactionMask); | 368 HEAP->CollectAllGarbage(Heap::kNoGCFlags); |
| 369 HEAP->CollectAllGarbage(Heap::kForceCompactionMask); | 369 HEAP->CollectAllGarbage(Heap::kNoGCFlags); |
| 370 | 370 |
| 371 Object* raw_foo; | 371 Object* raw_foo; |
| 372 { | 372 { |
| 373 v8::HandleScope handle_scope; | 373 v8::HandleScope handle_scope; |
| 374 v8::Local<v8::String> foo = v8::String::New("foo"); | 374 v8::Local<v8::String> foo = v8::String::New("foo"); |
| 375 ASSERT(!foo.IsEmpty()); | 375 ASSERT(!foo.IsEmpty()); |
| 376 raw_foo = *(v8::Utils::OpenHandle(*foo)); | 376 raw_foo = *(v8::Utils::OpenHandle(*foo)); |
| 377 } | 377 } |
| 378 | 378 |
| 379 int file_name_length = StrLength(FLAG_testing_serialization_file) + 10; | 379 int file_name_length = StrLength(FLAG_testing_serialization_file) + 10; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 ASSERT(!env.IsEmpty()); | 483 ASSERT(!env.IsEmpty()); |
| 484 env->Enter(); | 484 env->Enter(); |
| 485 // Make sure all builtin scripts are cached. | 485 // Make sure all builtin scripts are cached. |
| 486 { HandleScope scope; | 486 { HandleScope scope; |
| 487 for (int i = 0; i < Natives::GetBuiltinsCount(); i++) { | 487 for (int i = 0; i < Natives::GetBuiltinsCount(); i++) { |
| 488 Isolate::Current()->bootstrapper()->NativesSourceLookup(i); | 488 Isolate::Current()->bootstrapper()->NativesSourceLookup(i); |
| 489 } | 489 } |
| 490 } | 490 } |
| 491 // If we don't do this then we end up with a stray root pointing at the | 491 // If we don't do this then we end up with a stray root pointing at the |
| 492 // context even after we have disposed of env. | 492 // context even after we have disposed of env. |
| 493 HEAP->CollectAllGarbage(Heap::kForceCompactionMask); | 493 HEAP->CollectAllGarbage(Heap::kNoGCFlags); |
| 494 | 494 |
| 495 int file_name_length = StrLength(FLAG_testing_serialization_file) + 10; | 495 int file_name_length = StrLength(FLAG_testing_serialization_file) + 10; |
| 496 Vector<char> startup_name = Vector<char>::New(file_name_length + 1); | 496 Vector<char> startup_name = Vector<char>::New(file_name_length + 1); |
| 497 OS::SNPrintF(startup_name, "%s.startup", FLAG_testing_serialization_file); | 497 OS::SNPrintF(startup_name, "%s.startup", FLAG_testing_serialization_file); |
| 498 | 498 |
| 499 env->Exit(); | 499 env->Exit(); |
| 500 | 500 |
| 501 Object* raw_context = *(v8::Utils::OpenHandle(*env)); | 501 Object* raw_context = *(v8::Utils::OpenHandle(*env)); |
| 502 | 502 |
| 503 env.Dispose(); | 503 env.Dispose(); |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 TEST(TestThatAlwaysFails) { | 679 TEST(TestThatAlwaysFails) { |
| 680 bool ArtificialFailure = false; | 680 bool ArtificialFailure = false; |
| 681 CHECK(ArtificialFailure); | 681 CHECK(ArtificialFailure); |
| 682 } | 682 } |
| 683 | 683 |
| 684 | 684 |
| 685 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { | 685 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { |
| 686 bool ArtificialFailure2 = false; | 686 bool ArtificialFailure2 = false; |
| 687 CHECK(ArtificialFailure2); | 687 CHECK(ArtificialFailure2); |
| 688 } | 688 } |
| OLD | NEW |