mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-07 10:06:03 +00:00
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.
This commit is contained in:
parent
b4ff6c2c93
commit
74cedf0077
2 changed files with 3 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
|||
Port1: "Hello"
|
||||
Port1: {"foo":{}}
|
||||
Port1: "DONE"
|
||||
Port2: "Hello"
|
||||
Port3: "Hello from the transferred port"
|
||||
Port1: "DONE"
|
||||
Port2: "DONE"
|
||||
|
|
|
@ -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");
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue