| 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 CHECK(HEAP->symbol_table()->IsSymbolTable()); | 286 CHECK(HEAP->symbol_table()->IsSymbolTable()); |
| 287 CHECK(!Factory::LookupAsciiSymbol("Empty")->IsFailure()); | 287 CHECK(!Factory::LookupAsciiSymbol("Empty")->IsFailure()); |
| 288 } | 288 } |
| 289 | 289 |
| 290 | 290 |
| 291 DEPENDENT_TEST(Deserialize, Serialize) { | 291 DEPENDENT_TEST(Deserialize, Serialize) { |
| 292 // The serialize-deserialize tests only work if the VM is built without | 292 // The serialize-deserialize tests only work if the VM is built without |
| 293 // serialization. That doesn't matter. We don't need to be able to | 293 // serialization. That doesn't matter. We don't need to be able to |
| 294 // serialize a snapshot in a VM that is booted from a snapshot. | 294 // serialize a snapshot in a VM that is booted from a snapshot. |
| 295 if (!Snapshot::IsEnabled()) { | 295 if (!Snapshot::IsEnabled()) { |
| 296 | |
| 297 Deserialize(); | 296 Deserialize(); |
| 298 | 297 |
| 299 v8::Persistent<v8::Context> env = v8::Context::New(); | 298 v8::Persistent<v8::Context> env = v8::Context::New(); |
| 300 env->Enter(); | 299 env->Enter(); |
| 301 | 300 |
| 302 SanityCheck(); | 301 SanityCheck(); |
| 303 } | 302 } |
| 304 } | 303 } |
| 305 | 304 |
| 306 | 305 |
| 307 DEPENDENT_TEST(DeserializeFromSecondSerialization, SerializeTwice) { | 306 DEPENDENT_TEST(DeserializeFromSecondSerialization, SerializeTwice) { |
| 308 if (!Snapshot::IsEnabled()) { | 307 if (!Snapshot::IsEnabled()) { |
| 309 | |
| 310 Deserialize(); | 308 Deserialize(); |
| 311 | 309 |
| 312 v8::Persistent<v8::Context> env = v8::Context::New(); | 310 v8::Persistent<v8::Context> env = v8::Context::New(); |
| 313 env->Enter(); | 311 env->Enter(); |
| 314 | 312 |
| 315 SanityCheck(); | 313 SanityCheck(); |
| 316 } | 314 } |
| 317 } | 315 } |
| 318 | 316 |
| 319 | 317 |
| 320 DEPENDENT_TEST(DeserializeAndRunScript2, Serialize) { | 318 DEPENDENT_TEST(DeserializeAndRunScript2, Serialize) { |
| 321 if (!Snapshot::IsEnabled()) { | 319 if (!Snapshot::IsEnabled()) { |
| 322 | |
| 323 Deserialize(); | 320 Deserialize(); |
| 324 | 321 |
| 325 v8::Persistent<v8::Context> env = v8::Context::New(); | 322 v8::Persistent<v8::Context> env = v8::Context::New(); |
| 326 env->Enter(); | 323 env->Enter(); |
| 327 | 324 |
| 328 v8::HandleScope scope; | 325 v8::HandleScope scope; |
| 329 const char* c_source = "\"1234\".length"; | 326 const char* c_source = "\"1234\".length"; |
| 330 v8::Local<v8::String> source = v8::String::New(c_source); | 327 v8::Local<v8::String> source = v8::String::New(c_source); |
| 331 v8::Local<v8::Script> script = v8::Script::Compile(source); | 328 v8::Local<v8::Script> script = v8::Script::Compile(source); |
| 332 CHECK_EQ(4, script->Run()->Int32Value()); | 329 CHECK_EQ(4, script->Run()->Int32Value()); |
| 333 } | 330 } |
| 334 } | 331 } |
| 335 | 332 |
| 336 | 333 |
| 337 DEPENDENT_TEST(DeserializeFromSecondSerializationAndRunScript2, | 334 DEPENDENT_TEST(DeserializeFromSecondSerializationAndRunScript2, |
| 338 SerializeTwice) { | 335 SerializeTwice) { |
| 339 if (!Snapshot::IsEnabled()) { | 336 if (!Snapshot::IsEnabled()) { |
| 340 | |
| 341 Deserialize(); | 337 Deserialize(); |
| 342 | 338 |
| 343 v8::Persistent<v8::Context> env = v8::Context::New(); | 339 v8::Persistent<v8::Context> env = v8::Context::New(); |
| 344 env->Enter(); | 340 env->Enter(); |
| 345 | 341 |
| 346 v8::HandleScope scope; | 342 v8::HandleScope scope; |
| 347 const char* c_source = "\"1234\".length"; | 343 const char* c_source = "\"1234\".length"; |
| 348 v8::Local<v8::String> source = v8::String::New(c_source); | 344 v8::Local<v8::String> source = v8::String::New(c_source); |
| 349 v8::Local<v8::Script> script = v8::Script::Compile(source); | 345 v8::Local<v8::Script> script = v8::Script::Compile(source); |
| 350 CHECK_EQ(4, script->Run()->Int32Value()); | 346 CHECK_EQ(4, script->Run()->Int32Value()); |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 TEST(TestThatAlwaysFails) { | 657 TEST(TestThatAlwaysFails) { |
| 662 bool ArtificialFailure = false; | 658 bool ArtificialFailure = false; |
| 663 CHECK(ArtificialFailure); | 659 CHECK(ArtificialFailure); |
| 664 } | 660 } |
| 665 | 661 |
| 666 | 662 |
| 667 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { | 663 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { |
| 668 bool ArtificialFailure2 = false; | 664 bool ArtificialFailure2 = false; |
| 669 CHECK(ArtificialFailure2); | 665 CHECK(ArtificialFailure2); |
| 670 } | 666 } |
| OLD | NEW |