OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src=media-file.js></script> | 4 <script src=media-file.js></script> |
5 <script src=video-test.js></script> | 5 <script src=video-test.js></script> |
6 | 6 |
7 <script> | 7 <script> |
8 var controller; | 8 var controller; |
9 var video2; | 9 var video2; |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 consoleWrite("Test that setting mediaGroup to an empty string remove
s the controller:") | 24 consoleWrite("Test that setting mediaGroup to an empty string remove
s the controller:") |
25 run("video.mediaGroup = ''"); | 25 run("video.mediaGroup = ''"); |
26 testExpected("video.controller", null); | 26 testExpected("video.controller", null); |
27 consoleWrite(""); | 27 consoleWrite(""); |
28 consoleWrite("Test manually creating and assigning a controller to a
media element:") | 28 consoleWrite("Test manually creating and assigning a controller to a
media element:") |
29 run("controller = new MediaController()"); | 29 run("controller = new MediaController()"); |
30 run("video.controller = controller"); | 30 run("video.controller = controller"); |
31 testExpected("video.controller", controller); | 31 testExpected("video.controller", controller); |
32 consoleWrite(""); | 32 consoleWrite(""); |
33 consoleWrite("Test assigning the wrong type to the controller attrib
ute of a media element:") | 33 consoleWrite("Test assigning the wrong type to the controller attrib
ute of a media element:") |
34 testException("video.controller = 42", '"TypeError: Value is not of
type MediaController"'); | 34 testException("video.controller = 42", '"TypeError: Failed to set th
e \'controller\' property on \'HTMLMediaElement\': The provided value is not of
type \'MediaController\'."'); |
35 testExpected("video.controller", controller); | 35 testExpected("video.controller", controller); |
36 consoleWrite(""); | 36 consoleWrite(""); |
37 consoleWrite("Test assigning a null controller to a media element:") | 37 consoleWrite("Test assigning a null controller to a media element:") |
38 run("video.controller = null"); | 38 run("video.controller = null"); |
39 testExpected("video.controller", null); | 39 testExpected("video.controller", null); |
40 consoleWrite(""); | 40 consoleWrite(""); |
41 consoleWrite("Test that two media elements with the same mediaGroup
have the same controller:") | 41 consoleWrite("Test that two media elements with the same mediaGroup
have the same controller:") |
42 run("video.mediaGroup = 'group'"); | 42 run("video.mediaGroup = 'group'"); |
43 run("video2.mediaGroup = 'group'"); | 43 run("video2.mediaGroup = 'group'"); |
44 testExpected("video.controller === video2.controller", true); | 44 testExpected("video.controller === video2.controller", true); |
| 45 consoleWrite(""); |
| 46 consoleWrite("Test that setting the controller clears the mediaGroup
:") |
| 47 testExpected("video.mediaGroup", "group"); |
| 48 run("video.controller = null"); |
| 49 testExpected("video.controller", null); |
| 50 testExpected("video.hasAttribute('mediaGroup')", false); |
| 51 testExpected("video.mediaGroup", ""); |
| 52 run("video.mediaGroup = 'group'"); |
| 53 testExpected("video.mediaGroup", "group"); |
| 54 run("video.controller = controller"); |
| 55 testExpected("video.controller", controller); |
| 56 testExpected("video.hasAttribute('mediaGroup')", false); |
| 57 testExpected("video.mediaGroup", ""); |
| 58 consoleWrite(""); |
| 59 consoleWrite("Test that setting the controller to undefined is treat
ed as null:") |
| 60 testExpected("video.controller", null, "!="); |
| 61 run("video.controller = undefined"); |
| 62 testExpected("video.controller", null); |
45 endTest(); | 63 endTest(); |
46 } | 64 } |
47 </script> | 65 </script> |
48 </head> | 66 </head> |
49 <body onload="start()"> | 67 <body onload="start()"> |
50 <video></video> | 68 <video></video> |
51 <video mediagroup="group"></video> | 69 <video mediagroup="group"></video> |
52 </body> | 70 </body> |
53 </html> | 71 </html> |
OLD | NEW |