https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 0ebbaaad184b1f9d2d27e91c5c623cce85149a82 authored by bylee on 12 April 2014, 04:46:17 UTC
Add test-case that if both types of custom element types are provided at the time of element's instantiation, the custom tag must win over the type extension.
Tip revision: 0ebbaaa
Channel_MessagePort_onmessage_start.htm
<!DOCTYPE html>
<html>
<head>
<title> MessageChannel: port.onmessage enables message queue </title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id=log></div>
<script>

    var TestResult = false;
    var description = "The first time a MessagePort object's onmessage IDL attribute is set, the port's "
                    + "port message queue must be enabled, as if the start() method had been called.";

    var t = async_test("Test Description: " + description);

    var channel = new MessageChannel();

    channel.port2.onmessage = TestMessageEvent;

    channel.port1.postMessage("ping");

    setTimeout(t.step_func(VerifyResult), 100);

    function TestMessageEvent(evt)
    {
        TestResult = true;
    }

    function VerifyResult()
    {
        assert_true(TestResult, "Port message queue is enabled?");
        t.done();
    }
</script>
</body>
</html>
back to top