Test running the macOS engine has no stray logging (flutter/engine#54716)

Assert that running the macOS engine does not log anything unexpected 
See also issue https://github.com/flutter/flutter/issues/111577
Similar Windows check in https://github.com/flutter/engine/pull/47774

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
Jenn Magder
2024-08-22 15:40:10 -07:00
committed by GitHub
parent 98f1580a2b
commit 7e82588c31

View File

@@ -210,6 +210,7 @@ TEST_F(FlutterEngineTest, CanLogToStdout) {
// 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 @@ TEST_F(FlutterEngineTest, CanLogToStdout) {
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) {