Add new access object callback
[framework/web/webkit-efl.git] / LayoutTests / media / video-dom-preload.html
1 <html>
2     <head>
3         <script src=video-test.js></script>
4         <script>
5             function setPreload(value, expected)
6             {
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("");
18
19             }
20
21             function test()
22             {
23                 findMediaElement();
24                 consoleWrite("");
25
26                 consoleWrite("++ Test default attribute value");
27                 testExpected("video.preload", "auto");
28                 testExpected("video.getAttribute('preload')", null);
29                 consoleWrite("");
30
31                 consoleWrite("++ Remove attribute, should revert to default");
32                 run("video.removeAttribute('preload')");
33                 testExpected("video.preload", "auto");
34                 consoleWrite("");
35
36                 consoleWrite("++ Set to 'none'");
37                 setPreload("none", "none");
38
39                 consoleWrite("++ Set to 'auto'");
40                 setPreload("auto", "auto");
41
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("");
53
54                 consoleWrite("++ Set to 'metadata'");
55                 setPreload("metadata", "metadata");
56         
57                 endTest();
58             }
59         </script>
60
61     </head>
62
63     <body onload="test()">
64         <video controls></video>
65     </body>
66 </html>
67