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

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

Issue 153773002: A64: Synchronize with r16679. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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-strtod.cc ('k') | test/cctest/test-utils.cc » ('j') | 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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 CHECK(v8::V8::IsExecutionTerminating()); 317 CHECK(v8::V8::IsExecutionTerminating());
318 CHECK(try_catch.HasTerminated()); 318 CHECK(try_catch.HasTerminated());
319 v8::V8::CancelTerminateExecution(v8::Isolate::GetCurrent()); 319 v8::V8::CancelTerminateExecution(v8::Isolate::GetCurrent());
320 CHECK(!v8::V8::IsExecutionTerminating()); 320 CHECK(!v8::V8::IsExecutionTerminating());
321 } 321 }
322 322
323 323
324 // Test that a single thread of JavaScript execution can terminate 324 // Test that a single thread of JavaScript execution can terminate
325 // itself and then resume execution. 325 // itself and then resume execution.
326 TEST(TerminateCancelTerminateFromThreadItself) { 326 TEST(TerminateCancelTerminateFromThreadItself) {
327 v8::HandleScope scope; 327 v8::Isolate* isolate = v8::Isolate::GetCurrent();
328 v8::HandleScope scope(isolate);
328 v8::Handle<v8::ObjectTemplate> global = 329 v8::Handle<v8::ObjectTemplate> global =
329 CreateGlobalTemplate(TerminateCurrentThread, DoLoopCancelTerminate); 330 CreateGlobalTemplate(TerminateCurrentThread, DoLoopCancelTerminate);
330 v8::Handle<v8::Context> context = 331 v8::Handle<v8::Context> context = v8::Context::New(isolate, NULL, global);
331 v8::Context::New(v8::Isolate::GetCurrent(), NULL, global);
332 v8::Context::Scope context_scope(context); 332 v8::Context::Scope context_scope(context);
333 CHECK(!v8::V8::IsExecutionTerminating()); 333 CHECK(!v8::V8::IsExecutionTerminating());
334 v8::Handle<v8::String> source = 334 v8::Handle<v8::String> source =
335 v8::String::New("try { doloop(); } catch(e) { fail(); } 'completed';"); 335 v8::String::New("try { doloop(); } catch(e) { fail(); } 'completed';");
336 // Check that execution completed with correct return value. 336 // Check that execution completed with correct return value.
337 CHECK(v8::Script::Compile(source)->Run()->Equals(v8_str("completed"))); 337 CHECK(v8::Script::Compile(source)->Run()->Equals(v8_str("completed")));
338 } 338 }
339
OLDNEW
« no previous file with comments | « test/cctest/test-strtod.cc ('k') | test/cctest/test-utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698