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

Side by Side Diff: test/cctest/test-thread-termination.cc

Issue 23530045: Remove HandleScope default ctor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « test/cctest/test-mark-compact.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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 CHECK(v8::V8::IsExecutionTerminating()); 384 CHECK(v8::V8::IsExecutionTerminating());
385 CHECK(try_catch.HasTerminated()); 385 CHECK(try_catch.HasTerminated());
386 v8::V8::CancelTerminateExecution(v8::Isolate::GetCurrent()); 386 v8::V8::CancelTerminateExecution(v8::Isolate::GetCurrent());
387 CHECK(!v8::V8::IsExecutionTerminating()); 387 CHECK(!v8::V8::IsExecutionTerminating());
388 } 388 }
389 389
390 390
391 // Test that a single thread of JavaScript execution can terminate 391 // Test that a single thread of JavaScript execution can terminate
392 // itself and then resume execution. 392 // itself and then resume execution.
393 TEST(TerminateCancelTerminateFromThreadItself) { 393 TEST(TerminateCancelTerminateFromThreadItself) {
394 v8::HandleScope scope; 394 v8::Isolate* isolate = v8::Isolate::GetCurrent();
395 v8::HandleScope scope(isolate);
395 v8::Handle<v8::ObjectTemplate> global = 396 v8::Handle<v8::ObjectTemplate> global =
396 CreateGlobalTemplate(TerminateCurrentThread, DoLoopCancelTerminate); 397 CreateGlobalTemplate(TerminateCurrentThread, DoLoopCancelTerminate);
397 v8::Handle<v8::Context> context = 398 v8::Handle<v8::Context> context = v8::Context::New(isolate, NULL, global);
398 v8::Context::New(v8::Isolate::GetCurrent(), NULL, global);
399 v8::Context::Scope context_scope(context); 399 v8::Context::Scope context_scope(context);
400 CHECK(!v8::V8::IsExecutionTerminating()); 400 CHECK(!v8::V8::IsExecutionTerminating());
401 v8::Handle<v8::String> source = 401 v8::Handle<v8::String> source =
402 v8::String::New("try { doloop(); } catch(e) { fail(); } 'completed';"); 402 v8::String::New("try { doloop(); } catch(e) { fail(); } 'completed';");
403 // Check that execution completed with correct return value. 403 // Check that execution completed with correct return value.
404 CHECK(v8::Script::Compile(source)->Run()->Equals(v8_str("completed"))); 404 CHECK(v8::Script::Compile(source)->Run()->Equals(v8_str("completed")));
405 } 405 }
406
OLDNEW
« no previous file with comments | « test/cctest/test-mark-compact.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698