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

Unified Diff: runtime/vm/dart_api_impl_test.cc

Issue 2223913002: Add an API for setting the sticky error (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: asiva review Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl_test.cc
diff --git a/runtime/vm/dart_api_impl_test.cc b/runtime/vm/dart_api_impl_test.cc
index 3dbf3f6d43d645ed06f216d6a888a693bb82243b..b7348e44e55199d0cec8f5300e4ae409abcbac75 100644
--- a/runtime/vm/dart_api_impl_test.cc
+++ b/runtime/vm/dart_api_impl_test.cc
@@ -3618,6 +3618,19 @@ UNIT_TEST_CASE(SetMessageCallbacks) {
}
+TEST_CASE(SetStickyError) {
+ const char* kScriptChars =
+ "main() => throw 'HI';";
+ Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
+ Dart_Handle retobj = Dart_Invoke(lib, NewString("main"), 0, NULL);
+ EXPECT(Dart_IsError(retobj));
+ EXPECT(Dart_IsUnhandledExceptionError(retobj));
+ EXPECT(!Dart_HasStickyError());
+ Dart_SetStickyError(retobj);
+ EXPECT(Dart_HasStickyError());
+}
+
+
TEST_CASE(TypeGetNonParamtericTypes) {
const char* kScriptChars =
"class MyClass0 {\n"
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698