3 <script src="media-file.js"></script>
4 <script src=video-test.js></script>
9 if (window.testRunner) {
10 if (!window.eventSender) {
11 testRunner.dumpAsText();
23 x = video.offsetParent.offsetLeft + video.offsetLeft + video.offsetWidth / 2;
24 y = video.offsetParent.offsetTop + video.offsetTop + video.offsetHeight / 2;
25 eventSender.mouseMoveTo(x, y);
26 items = eventSender.contextClick();
29 for (var i = 0; i < items.length; i++)
31 if (items[i].title.match("Controls")) {
32 testExpected("video.controls", true, '==');
33 consoleWrite("Toggling media controls");
35 testExpected("video.controls", false, '==');
39 if (items[i].title.match("Pause")) {
40 testExpected("video.paused", false, '==');
41 consoleWrite("Toggling play state");
43 testExpected("video.paused", true, '==');
47 if (items[i].title.match("Loop")) {
48 testExpected("video.loop", false, '==');
49 consoleWrite("Toggling loop state");
51 testExpected("video.loop", true, '==');
55 if (items[i].title.match("Mute")) {
56 testExpected("video.muted", false, '==');
57 consoleWrite("Toggling mute state");
59 testExpected("video.muted", true, '==');
63 if (items[i].title.match("Fullscreen") && video.webkitSupportsFullscreen) {
64 testExpected("video.webkitDisplayingFullscreen", false, '==');
65 consoleWrite("Toggling fullscreen state");
67 testExpected("video.webkitDisplayingFullscreen", true, '==');
71 // TODO: test copy link location and open in new window.
73 testRunner.dumpAsText();
80 waitForEvent('play', playing);
81 run("video.src = '" + findMediaFile("video", "content/test") + "'");
86 <body onload="start()">
87 <p>Test the various actions available in the HTML5 media element context-menu.</p>
88 <video id="video" autoplay controls></video>