Video is not started even if play button has been pressed.
[framework/web/webkit-efl.git] / LayoutTests / fast / events / custom-event.html
1 <script>
2     if (window.testRunner) {
3         testRunner.dumpAsText();
4     }
5
6     function log(m)
7     {
8         var results = document.getElementById('results');
9         results.innerHTML += m + '<br>';
10     }
11
12     function shouldBe(aDescription, a, b)
13     {
14         if (a === b) {
15             log("PASS: " + aDescription + " should be '" + b + "' and is.");
16         } else {
17             log("FAIL: " + aDescription + " should be '" + b + "' but instead is '" + a + "'.");
18         }
19     }
20
21     function dispatchCustomEvent(name, value)
22     {
23         var ev = document.createEvent("CustomEvent");
24         ev.initCustomEvent(name, true, false, value);
25         document.dispatchEvent(ev);
26     }
27
28     function runTests()
29     {
30         addEventListener("blah", function() {
31             shouldBe("arguments[0].detail.result of the CustomEvent", arguments[0].detail.result, "success");
32         }, false);
33         addEventListener("blah2", function() {
34             shouldBe("arguments[0].detail of the CustomEvent", arguments[0].detail, "success");
35         }, false);
36
37         dispatchCustomEvent("blah", { result: "success" });
38         dispatchCustomEvent("blah2", "success");
39     }
40 </script>
41
42 <body onload="runTests()">
43     <div id="results"></div>
44 </body>
45 </html>