Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: test/cctest/test-serialize.cc

Issue 2476001: Current HandleScope moving to Isolate. (Closed)
Patch Set: removed unnesessary initializing constand, using existing Initialize() for handle scope data. Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/isolate.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 v8::HandleScope scope;
297 296
298 Deserialize(); 297 Deserialize();
299 298
300 v8::Persistent<v8::Context> env = v8::Context::New(); 299 v8::Persistent<v8::Context> env = v8::Context::New();
301 env->Enter(); 300 env->Enter();
302 301
303 SanityCheck(); 302 SanityCheck();
304 } 303 }
305 } 304 }
306 305
307 306
308 DEPENDENT_TEST(DeserializeFromSecondSerialization, SerializeTwice) { 307 DEPENDENT_TEST(DeserializeFromSecondSerialization, SerializeTwice) {
309 if (!Snapshot::IsEnabled()) { 308 if (!Snapshot::IsEnabled()) {
310 v8::HandleScope scope;
311 309
312 Deserialize(); 310 Deserialize();
313 311
314 v8::Persistent<v8::Context> env = v8::Context::New(); 312 v8::Persistent<v8::Context> env = v8::Context::New();
315 env->Enter(); 313 env->Enter();
316 314
317 SanityCheck(); 315 SanityCheck();
318 } 316 }
319 } 317 }
320 318
321 319
322 DEPENDENT_TEST(DeserializeAndRunScript2, Serialize) { 320 DEPENDENT_TEST(DeserializeAndRunScript2, Serialize) {
323 if (!Snapshot::IsEnabled()) { 321 if (!Snapshot::IsEnabled()) {
324 v8::HandleScope scope;
325 322
326 Deserialize(); 323 Deserialize();
327 324
328 v8::Persistent<v8::Context> env = v8::Context::New(); 325 v8::Persistent<v8::Context> env = v8::Context::New();
329 env->Enter(); 326 env->Enter();
330 327
328 v8::HandleScope scope;
331 const char* c_source = "\"1234\".length"; 329 const char* c_source = "\"1234\".length";
332 v8::Local<v8::String> source = v8::String::New(c_source); 330 v8::Local<v8::String> source = v8::String::New(c_source);
333 v8::Local<v8::Script> script = v8::Script::Compile(source); 331 v8::Local<v8::Script> script = v8::Script::Compile(source);
334 CHECK_EQ(4, script->Run()->Int32Value()); 332 CHECK_EQ(4, script->Run()->Int32Value());
335 } 333 }
336 } 334 }
337 335
338 336
339 DEPENDENT_TEST(DeserializeFromSecondSerializationAndRunScript2, 337 DEPENDENT_TEST(DeserializeFromSecondSerializationAndRunScript2,
340 SerializeTwice) { 338 SerializeTwice) {
341 if (!Snapshot::IsEnabled()) { 339 if (!Snapshot::IsEnabled()) {
342 v8::HandleScope scope;
343 340
344 Deserialize(); 341 Deserialize();
345 342
346 v8::Persistent<v8::Context> env = v8::Context::New(); 343 v8::Persistent<v8::Context> env = v8::Context::New();
347 env->Enter(); 344 env->Enter();
348 345
346 v8::HandleScope scope;
349 const char* c_source = "\"1234\".length"; 347 const char* c_source = "\"1234\".length";
350 v8::Local<v8::String> source = v8::String::New(c_source); 348 v8::Local<v8::String> source = v8::String::New(c_source);
351 v8::Local<v8::Script> script = v8::Script::Compile(source); 349 v8::Local<v8::Script> script = v8::Script::Compile(source);
352 CHECK_EQ(4, script->Run()->Int32Value()); 350 CHECK_EQ(4, script->Run()->Int32Value());
353 } 351 }
354 } 352 }
355 353
356 354
357 TEST(PartialSerialization) { 355 TEST(PartialSerialization) {
358 Serializer::Enable(); 356 Serializer::Enable();
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 TEST(TestThatAlwaysFails) { 661 TEST(TestThatAlwaysFails) {
664 bool ArtificialFailure = false; 662 bool ArtificialFailure = false;
665 CHECK(ArtificialFailure); 663 CHECK(ArtificialFailure);
666 } 664 }
667 665
668 666
669 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { 667 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) {
670 bool ArtificialFailure2 = false; 668 bool ArtificialFailure2 = false;
671 CHECK(ArtificialFailure2); 669 CHECK(ArtificialFailure2);
672 } 670 }
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698