Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Test running the macOS engine has no stray logging #54716

Merged
merged 2 commits into from
Aug 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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) {
Expand Down