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

Unified Diff: runtime/vm/dart_api_impl_test.cc

Issue 1190413006: Fix line width issue. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | no next file » | 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 a3a436b8d57f3ad364d85c6d9afa6161097f4973..0b6679e7d35423b212a5a0febdce8e4a651adb0c 100644
--- a/runtime/vm/dart_api_impl_test.cc
+++ b/runtime/vm/dart_api_impl_test.cc
@@ -448,6 +448,45 @@ TEST_CASE(ErrorHandleTypes) {
}
+TEST_CASE(UnhandleExceptionError) {
+ Isolate* isolate = Isolate::Current();
+
+ // Test with an API Error.
+ Dart_Handle api_error = Api::NewHandle(
+ isolate,
+ ApiError::New(String::Handle(String::New("Api Error Exception Test."))));
+ Dart_Handle exception_error = Dart_NewUnhandledExceptionError(api_error);
+ EXPECT(!Dart_IsApiError(exception_error));
+ EXPECT(Dart_IsUnhandledExceptionError(exception_error));
+
rmacnak 2015/06/19 23:26:10 EXPECT(Dart_IsString(Dart_ErrorGetException(except
siva 2015/06/19 23:43:44 Done.
+ // Test with a Compilation Error.
+ const String& compile_message =
+ String::Handle(String::New("CompileError Exception Test."));
+ Dart_Handle compile_error =
+ Api::NewHandle(isolate, LanguageError::New(compile_message));
+ exception_error = Dart_NewUnhandledExceptionError(compile_error);
+ EXPECT(!Dart_IsApiError(exception_error));
+ EXPECT(Dart_IsUnhandledExceptionError(exception_error));
+
rmacnak 2015/06/19 23:26:10 Ditto
siva 2015/06/19 23:43:44 Done.
+ // Test with a Fatal Error.
+ const String& fatal_message =
+ String::Handle(String::New("FatalError Exception Test."));
+ Dart_Handle fatal_error =
+ Api::NewHandle(isolate, UnwindError::New(fatal_message));
+ exception_error = Dart_NewUnhandledExceptionError(fatal_error);
+ EXPECT(Dart_IsError(exception_error));
+ EXPECT(!Dart_IsUnhandledExceptionError(exception_error));
+
+ // Test with a Regular object.
+ Dart_Handle obj = Api::NewHandle(
+ isolate,
+ String::New("Regular String Exception Test."));
+ exception_error = Dart_NewUnhandledExceptionError(obj);
+ EXPECT(!Dart_IsApiError(exception_error));
+ EXPECT(Dart_IsUnhandledExceptionError(exception_error));
rmacnak 2015/06/19 23:26:10 Ditto
siva 2015/06/19 23:43:44 Done.
+}
+
+
void PropagateErrorNative(Dart_NativeArguments args) {
Dart_EnterScope();
Dart_Handle closure = Dart_GetNativeArgument(args, 0);
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698