Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / constructors / media-key-message-event-constructor.html
blobde7b02dcd27d1e54771ad90216005efd4a3146ea
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <script>
9 description("This tests the constructor for the MediaKeyMessageEvent DOM class.");
11 // No initializer is passed.
12 shouldBe("new MediaKeyMessageEvent('eventType').bubbles", "false");
13 shouldBe("new MediaKeyMessageEvent('eventType').cancelable", "false");
14 shouldBeEqualToString("new MediaKeyMessageEvent('eventType').messageType", "license-request");
15 shouldBeNull("new MediaKeyMessageEvent('eventType').message");
17 // bubbles is passed.
18 shouldBe("new MediaKeyMessageEvent('eventType', { bubbles: false }).bubbles", "false");
19 shouldBe("new MediaKeyMessageEvent('eventType', { bubbles: true }).bubbles", "true");
21 // cancelable is passed.
22 shouldBe("new MediaKeyMessageEvent('eventType', { cancelable: false }).cancelable", "false");
23 shouldBe("new MediaKeyMessageEvent('eventType', { cancelable: true }).cancelable", "true");
25 // message is passed.
26 var arrayBuffer = new ArrayBuffer(1);
27 shouldBe("new MediaKeyMessageEvent('eventType', { message: arrayBuffer }).message", "arrayBuffer");
29 // messageType is passed.
30 shouldBeEqualToString("new MediaKeyMessageEvent('eventType', { messageType: 'license-request' }).messageType", "license-request");
31 shouldBeEqualToString("new MediaKeyMessageEvent('eventType', { messageType: 'license-renewal' }).messageType", "license-renewal");
32 shouldBeEqualToString("new MediaKeyMessageEvent('eventType', { messageType: 'license-release' }).messageType", "license-release");
34 </script>
35 </body>
36 </html>