OLD | NEW |
---|---|
(Empty) | |
1 "use strict"; | |
2 | |
3 function fullscreen_test(controller, fullScreenEnabled) | |
4 { | |
5 if (window.internals) | |
6 window.internals.settings.setFullScreenEnabled(fullScreenEnabled); | |
7 | |
8 async_test(function(t) | |
9 { | |
10 var v1 = document.createElement("video"); | |
11 var v2 = document.createElement("video"); | |
12 v1.controls = v2.controls = true; | |
13 v1.controller = v2.controller = controller; | |
14 v1.src = findMediaFile("video", "content/test"); | |
15 v2.src = findMediaFile("audio", "content/test"); | |
16 document.body.appendChild(v1); | |
17 document.body.appendChild(v2); | |
18 | |
19 // load event fires when both video elements are ready | |
20 window.addEventListener("load", t.step_func(function() | |
21 { | |
22 function assert_button_hidden(elm) | |
23 { | |
24 assert_array_equals(mediaControlsButtonDimensions(elm, "fullscre en-button"), [0, 0]); | |
25 } | |
26 | |
27 if (fullScreenEnabled) { | |
28 // click the fullscreen button | |
29 var coords = mediaControlsButtonCoordinates(v1, "fullscreen-butt on"); | |
30 eventSender.mouseMoveTo(coords[0], coords[1]); | |
31 eventSender.mouseDown(); | |
32 eventSender.mouseUp(); | |
33 // wait for the fullscreenchange event | |
34 } else { | |
35 // no fullscreen button when fullscreen is disabled | |
36 assert_button_hidden(v1); | |
37 t.done(); | |
acolwell GONE FROM CHROMIUM
2014/03/17 23:57:55
nit: early return here since the test is supposed
philipj_slow
2014/03/18 03:08:02
Ah, yes. testharness.js actually ignores anything
| |
38 } | |
39 | |
40 // no fullscreen button for a video element with no video track | |
41 assert_button_hidden(v2); | |
42 })); | |
43 | |
44 v1.addEventListener("webkitfullscreenchange", t.step_func(function() | |
acolwell GONE FROM CHROMIUM
2014/03/17 23:57:55
Why are we waiting for prefixed events?
philipj_slow
2014/03/18 03:08:02
The fullscreen API is still not unprefixed, so the
| |
45 { | |
46 t.done(); | |
47 })); | |
48 | |
49 v2.addEventListener("webkitfullscreenchange", t.step_func(function() | |
50 { | |
51 assert_unreached(); | |
52 })); | |
53 }); | |
54 } | |
OLD | NEW |