3 <script src=video-test.js
></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
);
26 consoleWrite("++ Test default attribute value");
27 testExpected("video.preload", "auto");
28 testExpected("video.getAttribute('preload')", null);
31 consoleWrite("++ Remove attribute, should revert to default");
32 run("video.removeAttribute('preload')");
33 testExpected("video.preload", "auto");
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");
54 consoleWrite("++ Set to 'metadata'");
55 setPreload("metadata", "metadata");
63 <body onload=
"test()">
64 <video controls
></video>