2 Test presence of MediaController constructor, controller, and mediaGroup attributes:
3 EXPECTED (typeof(MediaController) != 'undefined') OK
4 EXPECTED (video.controller == 'null') OK
5 EXPECTED (video.mediaGroup == '') OK
7 Test that the presence of a mediaGroup attribute creates a controller:
8 EXPECTED (video2.mediaGroup == 'group') OK
9 EXPECTED (video2.controller != 'null') OK
11 Test that setting mediaGroup to an empty string removes the controller:
12 RUN(video.mediaGroup = '')
13 EXPECTED (video.controller == 'null') OK
15 Test manually creating and assigning a controller to a media element:
16 RUN(controller = new MediaController())
17 RUN(video.controller = controller)
18 EXPECTED (video.controller == '[object MediaController]') OK
20 Test assigning the wrong type to the controller attribute of a media element:
21 TEST(video.controller = 42) THROWS("TypeError: Failed to set the 'controller' property on 'HTMLMediaElement': The provided value is not of type 'MediaController'.") OK
22 EXPECTED (video.controller == '[object MediaController]') OK
24 Test assigning a null controller to a media element:
25 RUN(video.controller = null)
26 EXPECTED (video.controller == 'null') OK
28 Test that two media elements with the same mediaGroup have the same controller:
29 RUN(video.mediaGroup = 'group')
30 RUN(video2.mediaGroup = 'group')
31 EXPECTED (video.controller === video2.controller == 'true') OK
33 Test that setting the controller clears the mediaGroup:
34 EXPECTED (video.mediaGroup == 'group') OK
35 RUN(video.controller = null)
36 EXPECTED (video.controller == 'null') OK
37 EXPECTED (video.hasAttribute('mediaGroup') == 'false') OK
38 EXPECTED (video.mediaGroup == '') OK
39 RUN(video.mediaGroup = 'group')
40 EXPECTED (video.mediaGroup == 'group') OK
41 RUN(video.controller = controller)
42 EXPECTED (video.controller == '[object MediaController]') OK
43 EXPECTED (video.hasAttribute('mediaGroup') == 'false') OK
44 EXPECTED (video.mediaGroup == '') OK
46 Test that setting the controller to undefined is treated as null:
47 EXPECTED (video.controller != 'null') OK
48 RUN(video.controller = undefined)
49 EXPECTED (video.controller == 'null') OK