mirror of
https://github.com/servo/servo.git
synced 2025-07-12 01:43:43 +01:00
18 lines
512 B
HTML
18 lines
512 B
HTML
<!doctype html>
|
|
<title>basic messagechannel with transfer</title>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<div id="log"></div>
|
|
<script>
|
|
async_test(function(t) {
|
|
var channel = new MessageChannel();
|
|
var ab = new ArrayBuffer(1);
|
|
channel.port1.postMessage(ab, {transfer: [ab]});
|
|
channel.port2.onmessage = t.step_func(
|
|
function(e) {
|
|
assert_equals(e.data.byteLength, 1);
|
|
t.done();
|
|
});
|
|
channel.port2.start();
|
|
});
|
|
</script>
|