From af2dae63d1cdfd06d33e1b997d05f658a6920cec Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Tue, 8 Apr 2025 16:41:45 +0200 Subject: [PATCH] Tests: Rearrange message order in Messaging-post-channel-over-channel The way this test was written didn't guarantee a deterministic message order, resulting in different output in Chromium and Firefox. This change slightly rearranges the message order to make it deterministic. This change is necessary as a prepartion for upcoming change that makes MessagePort post messages from a separate thread, which would've revealed the non-deterministic message order. --- .../Messaging/Messaging-post-channel-over-channel.txt | 2 +- .../input/Messaging/Messaging-post-channel-over-channel.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/LibWeb/Text/expected/Messaging/Messaging-post-channel-over-channel.txt b/Tests/LibWeb/Text/expected/Messaging/Messaging-post-channel-over-channel.txt index 192dd3d0914..0ebf505f534 100644 --- a/Tests/LibWeb/Text/expected/Messaging/Messaging-post-channel-over-channel.txt +++ b/Tests/LibWeb/Text/expected/Messaging/Messaging-post-channel-over-channel.txt @@ -1,6 +1,6 @@ Port1: "Hello" Port1: {"foo":{}} -Port1: "DONE" Port2: "Hello" Port3: "Hello from the transferred port" +Port1: "DONE" Port2: "DONE" diff --git a/Tests/LibWeb/Text/input/Messaging/Messaging-post-channel-over-channel.html b/Tests/LibWeb/Text/input/Messaging/Messaging-post-channel-over-channel.html index ed1cd00137d..7ef3b100abd 100644 --- a/Tests/LibWeb/Text/input/Messaging/Messaging-post-channel-over-channel.html +++ b/Tests/LibWeb/Text/input/Messaging/Messaging-post-channel-over-channel.html @@ -23,11 +23,11 @@ let channel2 = new MessageChannel(); channel2.port2.onmessage = (event) => { - println("Port3: " + JSON.stringify(event.data)) + println("Port3: " + JSON.stringify(event.data)); + channel.port2.postMessage("DONE"); } channel.port2.postMessage("Hello"); channel.port2.postMessage({ foo: channel2.port1 }, { transfer: [channel2.port1] }); - channel.port2.postMessage("DONE"); });