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

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

Issue 2636903002: Assert that context creation doesn't throw (Closed)
Patch Set: updates Created 3 years, 11 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') | test/cctest/wasm/test-wasm-stack.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 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 CHECK(error->IsNativeError()); 523 CHECK(error->IsNativeError());
524 } 524 }
525 525
526 526
527 void InnerTryCallTerminate(const v8::FunctionCallbackInfo<v8::Value>& args) { 527 void InnerTryCallTerminate(const v8::FunctionCallbackInfo<v8::Value>& args) {
528 CHECK(!args.GetIsolate()->IsExecutionTerminating()); 528 CHECK(!args.GetIsolate()->IsExecutionTerminating());
529 v8::Local<v8::Object> global = CcTest::global(); 529 v8::Local<v8::Object> global = CcTest::global();
530 v8::Local<v8::Function> loop = v8::Local<v8::Function>::Cast( 530 v8::Local<v8::Function> loop = v8::Local<v8::Function>::Cast(
531 global->Get(CcTest::isolate()->GetCurrentContext(), v8_str("loop")) 531 global->Get(CcTest::isolate()->GetCurrentContext(), v8_str("loop"))
532 .ToLocalChecked()); 532 .ToLocalChecked());
533 i::MaybeHandle<i::Object> exception;
533 i::MaybeHandle<i::Object> result = 534 i::MaybeHandle<i::Object> result =
534 i::Execution::TryCall(CcTest::i_isolate(), v8::Utils::OpenHandle((*loop)), 535 i::Execution::TryCall(CcTest::i_isolate(), v8::Utils::OpenHandle((*loop)),
535 v8::Utils::OpenHandle((*global)), 0, NULL, NULL); 536 v8::Utils::OpenHandle((*global)), 0, nullptr,
537 i::Execution::MessageHandling::kReport, &exception);
536 CHECK(result.is_null()); 538 CHECK(result.is_null());
537 // TryCall ignores terminate execution, but rerequests the interrupt. 539 // TryCall ignores terminate execution, but rerequests the interrupt.
538 CHECK(!args.GetIsolate()->IsExecutionTerminating()); 540 CHECK(!args.GetIsolate()->IsExecutionTerminating());
539 CHECK(CompileRun("1 + 1;").IsEmpty()); 541 CHECK(CompileRun("1 + 1;").IsEmpty());
540 } 542 }
541 543
542 544
543 TEST(TerminationInInnerTryCall) { 545 TEST(TerminationInInnerTryCall) {
544 v8::Isolate* isolate = CcTest::isolate(); 546 v8::Isolate* isolate = CcTest::isolate();
545 v8::HandleScope scope(isolate); 547 v8::HandleScope scope(isolate);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 CHECK(value->IsFunction()); 588 CHECK(value->IsFunction());
587 // The first stack check after terminate has been re-requested fails. 589 // The first stack check after terminate has been re-requested fails.
588 CHECK(CompileRun("1 + 1").IsEmpty()); 590 CHECK(CompileRun("1 + 1").IsEmpty());
589 CHECK(!isolate->IsExecutionTerminating()); 591 CHECK(!isolate->IsExecutionTerminating());
590 // V8 then recovers. 592 // V8 then recovers.
591 v8::Maybe<int32_t> result = CompileRun("2 + 2")->Int32Value( 593 v8::Maybe<int32_t> result = CompileRun("2 + 2")->Int32Value(
592 v8::Isolate::GetCurrent()->GetCurrentContext()); 594 v8::Isolate::GetCurrent()->GetCurrentContext());
593 CHECK_EQ(4, result.FromJust()); 595 CHECK_EQ(4, result.FromJust());
594 CHECK(!isolate->IsExecutionTerminating()); 596 CHECK(!isolate->IsExecutionTerminating());
595 } 597 }
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | test/cctest/wasm/test-wasm-stack.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698