Skip to content

Commit 92ed690

Browse files
authored
Fixed race in incorrect windows platform channel test. (flutter#37012)
1 parent 1633410 commit 92ed690

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

shell/platform/windows/fixtures/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ void hiPlatformChannels() {
3232
ui.PlatformDispatcher.instance
3333
.sendPlatformMessage('hi', reply, (ByteData? reply) {});
3434
});
35-
callback(null);
35+
callback(data);
3636
});
3737
}
3838

shell/platform/windows/flutter_windows_engine_unittests.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,12 +295,12 @@ TEST_F(FlutterWindowsEngineTest, PlatformMessageRoundTrip) {
295295
binary_messenger->Send(
296296
channel, reinterpret_cast<uint8_t*>(payload), 5,
297297
[&did_call_reply](const uint8_t* reply, size_t reply_size) {
298-
EXPECT_EQ(reply_size, 3);
299-
EXPECT_EQ(reply[0], static_cast<uint8_t>('b'));
298+
EXPECT_EQ(reply_size, 5);
299+
EXPECT_EQ(reply[0], static_cast<uint8_t>('h'));
300300
did_call_reply = true;
301301
});
302302
// Rely on timeout mechanism in CI.
303-
while (!did_call_callback && !did_call_reply && !did_call_dart_reply) {
303+
while (!did_call_callback || !did_call_reply || !did_call_dart_reply) {
304304
engine->task_runner()->ProcessTasks();
305305
}
306306
}

0 commit comments

Comments
 (0)