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

Fixed race in incorrect windows platform channel test. #37012

Merged
merged 1 commit into from
Oct 25, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion shell/platform/windows/fixtures/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void hiPlatformChannels() {
ui.PlatformDispatcher.instance
.sendPlatformMessage('hi', reply, (ByteData? reply) {});
});
callback(null);
callback(data);
});
}

Expand Down
6 changes: 3 additions & 3 deletions shell/platform/windows/flutter_windows_engine_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -295,12 +295,12 @@ TEST_F(FlutterWindowsEngineTest, PlatformMessageRoundTrip) {
binary_messenger->Send(
channel, reinterpret_cast<uint8_t*>(payload), 5,
[&did_call_reply](const uint8_t* reply, size_t reply_size) {
EXPECT_EQ(reply_size, 3);
EXPECT_EQ(reply[0], static_cast<uint8_t>('b'));
EXPECT_EQ(reply_size, 5);
EXPECT_EQ(reply[0], static_cast<uint8_t>('h'));
did_call_reply = true;
});
// Rely on timeout mechanism in CI.
while (!did_call_callback && !did_call_reply && !did_call_dart_reply) {
while (!did_call_callback || !did_call_reply || !did_call_dart_reply) {
engine->task_runner()->ProcessTasks();
}
}
Expand Down