mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 12:20:00 +01: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
ab35325003
commit
af2dae63d1
|
|
@ -1,6 +1,6 @@
|
||||||
Port1: "Hello"
|
Port1: "Hello"
|
||||||
Port1: {"foo":{}}
|
Port1: {"foo":{}}
|
||||||
Port1: "DONE"
|
|
||||||
Port2: "Hello"
|
Port2: "Hello"
|
||||||
Port3: "Hello from the transferred port"
|
Port3: "Hello from the transferred port"
|
||||||
|
Port1: "DONE"
|
||||||
Port2: "DONE"
|
Port2: "DONE"
|
||||||
|
|
|
||||||
|
|
@ -23,11 +23,11 @@
|
||||||
let channel2 = new MessageChannel();
|
let channel2 = new MessageChannel();
|
||||||
|
|
||||||
channel2.port2.onmessage = (event) => {
|
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("Hello");
|
||||||
channel.port2.postMessage({ foo: channel2.port1 }, { transfer: [channel2.port1] });
|
channel.port2.postMessage({ foo: channel2.port1 }, { transfer: [channel2.port1] });
|
||||||
channel.port2.postMessage("DONE");
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user