55#include " flutter/runtime/dart_isolate.h"
66
77#include " flutter/fml/paths.h"
8- #include " flutter/testing/fixture_test.h"
98#include " flutter/runtime/dart_vm.h"
109#include " flutter/runtime/dart_vm_lifecycle.h"
1110#include " flutter/testing/dart_isolate_runner.h"
11+ #include " flutter/testing/fixture_test.h"
1212#include " flutter/testing/testing.h"
1313
1414namespace flutter {
@@ -17,8 +17,8 @@ namespace testing {
1717const std::string kernel_file_name = " no_plugin_registrant_kernel_blob.bin" ;
1818
1919class DartIsolateTest : public FixtureTest {
20- public:
21- DartIsolateTest () : FixtureTest(kernel_file_name) {}
20+ public:
21+ DartIsolateTest () : FixtureTest(kernel_file_name) {}
2222};
2323
2424TEST_F (DartIsolateTest, DartPluginRegistrantIsNotPresent) {
@@ -36,7 +36,14 @@ TEST_F(DartIsolateTest, DartPluginRegistrantIsNotPresent) {
3636 latch.Signal ();
3737 })));
3838
39- const auto settings = CreateSettingsForFixture ();
39+ auto settings = CreateSettingsForFixture ();
40+ auto did_throw_exception = false ;
41+ settings.unhandled_exception_callback = [&](const std::string& error,
42+ const std::string& stack_trace) {
43+ did_throw_exception = true ;
44+ return true ;
45+ };
46+
4047 auto vm_ref = DartVMRef::Create (settings);
4148 auto thread = CreateNewThread ();
4249 TaskRunners task_runners (GetCurrentTestName (), //
@@ -46,11 +53,10 @@ TEST_F(DartIsolateTest, DartPluginRegistrantIsNotPresent) {
4653 thread //
4754 );
4855
49-
50- auto kernel_file_path = fml::paths::JoinPaths ({GetFixturesPath (), kernel_file_name});
51- auto isolate = RunDartCodeInIsolate (vm_ref, settings, task_runners,
52- " main" , {},
53- kernel_file_path);
56+ auto kernel_file_path =
57+ fml::paths::JoinPaths ({GetFixturesPath (), kernel_file_name});
58+ auto isolate = RunDartCodeInIsolate (vm_ref, settings, task_runners, " main" ,
59+ {}, kernel_file_path);
5460
5561 ASSERT_TRUE (isolate);
5662 ASSERT_EQ (isolate->get ()->GetPhase (), DartIsolate::Phase::Running);
@@ -59,6 +65,7 @@ TEST_F(DartIsolateTest, DartPluginRegistrantIsNotPresent) {
5965
6066 ASSERT_EQ (messages.size (), 1u );
6167 ASSERT_EQ (messages[0 ], " main() was called" );
68+ ASSERT_FALSE (did_throw_exception);
6269}
6370
6471} // namespace testing
0 commit comments