Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / media / video-dom-preload.html
blob02f79de121cb237e397dc05c65f5910806991e87
1 <html>
2 <head>
3 <script src=video-test.js></script>
4 <script>
5 function setPreload(value, expected)
7 consoleWrite("- set via DOM");
8 run("video.removeAttribute('preload')");
9 run("video.preload = '" + value + "'");
10 testExpected("video.getAttribute('preload')", expected);
11 testExpected("video.preload", expected);
12 consoleWrite("- and via attribute");
13 run("video.removeAttribute('preload')");
14 run("video.setAttribute('preload', '" + value + "')");
15 testExpected("video.preload", expected);
16 testExpected("video.getAttribute('preload')", expected);
17 consoleWrite("");
21 function test()
23 findMediaElement();
24 consoleWrite("");
26 consoleWrite("++ Test default attribute value");
27 testExpected("video.preload", "auto");
28 testExpected("video.getAttribute('preload')", null);
29 consoleWrite("");
31 consoleWrite("++ Remove attribute, should revert to default");
32 run("video.removeAttribute('preload')");
33 testExpected("video.preload", "auto");
34 consoleWrite("");
36 consoleWrite("++ Set to 'none'");
37 setPreload("none", "none");
39 consoleWrite("++ Set to 'auto'");
40 setPreload("auto", "auto");
42 consoleWrite("++ set to bogus value, should revert to default value");
43 run("video.removeAttribute('preload')");
44 consoleWrite("- set via DOM");
45 run("video.preload = 'bogus'");
46 testExpected("video.getAttribute('preload')", "bogus");
47 testExpected("video.preload", "auto");
48 consoleWrite("- and via attribute");
49 run("video.setAttribute('preload', 'bogus')");
50 testExpected("video.preload", "auto");
51 testExpected("video.getAttribute('preload')", "bogus");
52 consoleWrite("");
54 consoleWrite("++ Set to 'metadata'");
55 setPreload("metadata", "metadata");
57 endTest();
59 </script>
61 </head>
63 <body onload="test()">
64 <video controls></video>
65 </body>
66 </html>