OLD | NEW |
1 <!doctype html> | 1 <!DOCTYPE html> |
2 <html> | 2 <title>Tests that the built-in controls are always enabled when JavaScript is di
sabled.</title> |
3 <head> | 3 <script src="../resources/testharness.js"></script> |
4 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 | 4 <script src="../resources/testharnessreport.js"></script> |
5 (Please avoid writing new tests using video-test.js) --> | 5 <iframe sandbox="allow-same-origin" src="resources/video-controls-no-scripting-i
frame.html" style="width: 400px; height: 320px;"></iframe> |
6 <script src="video-test.js" type="text/javascript"></script> | 6 <script> |
7 <script> | 7 async_test(function(t) { |
8 function setup() | 8 var iframe = document.querySelector("iframe"); |
9 { | |
10 if (!window.testRunner) { | |
11 consoleWrite("This test only works in DRT."); | |
12 return; | |
13 } | |
14 | 9 |
15 video = document.getElementById("fr").contentDocument.querySelector(
"video"); | 10 iframe.onload = t.step_func_done(function() { |
16 testExpected("internals.shadowRoot(video)", null, "!="); | 11 var video = iframe.contentDocument.querySelector("video"); |
17 controls = internals.shadowRoot(video).firstChild.firstChild; | 12 assert_not_equals(internals.shadowRoot(video), null); |
18 | 13 var controls = internals.shadowRoot(video).firstChild.firstChild; |
19 // Don't use "testExpected()" for the control location because not a
ll ports use the same size controls. | 14 assert_less_than_equal((controls.offsetTop + controls.offsetHeight), vid
eo.offsetHeight); |
20 reportExpected((controls.offsetTop + controls.offsetHeight) <= video
.offsetHeight, "controls.offsetTop + controls.offsetHeight", "<=", "video.offset
Height", controls.offsetTop + controls.offsetHeight); | 15 assert_equals(getComputedStyle(controls).opacity, "1"); |
21 | 16 }); |
22 testExpected("getComputedStyle(controls).opacity", 1); | 17 }); |
23 | 18 </script> |
24 consoleWrite(""); | |
25 endTest(); | |
26 } | |
27 </script> | |
28 </head> | |
29 | |
30 <body> | |
31 | |
32 <iframe sandbox="allow-same-origin" src="resources/video-controls-no-scr
ipting-iframe.html" id="fr" style="width: 400px; height: 320px; border: 1px soli
d black;"></iframe> | |
33 | |
34 <p>Tests that the built-in controls are always enabled when JavaScript i
s disabled.</p> | |
35 <pre id="console"></pre> | |
36 <script> | |
37 document.getElementById("fr").onload = setup; | |
38 </script> | |
39 </body> | |
40 </html> | |
OLD | NEW |