diff --git a/shell/platform/darwin/macos/framework/Source/FlutterEngineTest.mm b/shell/platform/darwin/macos/framework/Source/FlutterEngineTest.mm index b7d8eb231118e..7b7d4fb427f1a 100644 --- a/shell/platform/darwin/macos/framework/Source/FlutterEngineTest.mm +++ b/shell/platform/darwin/macos/framework/Source/FlutterEngineTest.mm @@ -210,6 +210,7 @@ @implementation MockableFlutterEngine // Replace stdout stream buffer with our own. StreamCapture stdout_capture(&std::cout); + StreamCapture stderr_capture(&std::cerr); // Launch the test entrypoint. FlutterEngine* engine = GetFlutterEngine(); @@ -219,9 +220,12 @@ @implementation MockableFlutterEngine latch.Wait(); stdout_capture.Stop(); + stderr_capture.Stop(); // Verify hello world was written to stdout. - EXPECT_TRUE(stdout_capture.GetOutput().find("Hello logging") != std::string::npos); + // Check equality to ensure no unexpected stray logging. + EXPECT_EQ(stdout_capture.GetOutput(), "flutter: Hello logging\n"); + EXPECT_TRUE(stderr_capture.GetOutput().empty()); } TEST_F(FlutterEngineTest, DISABLED_BackgroundIsBlack) {