Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / DeviceLight / create-event.html
blobc8f934f3396a9d274130253a4779870d7c51e179
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../../../resources/js-test.js"></script>
5 <script>
6 description("Tests that document.createEvent() works with DeviceLightEvent.");
8 var event = document.createEvent('DeviceLightEvent');
9 var newEvent = new DeviceLightEvent("devicelight", {
10 bubbles: true, cancelable: false,
11 value: 10
12 });
14 var defaultEvent = new DeviceLightEvent("devicelight");
16 shouldBeTrue("typeof event == 'object'");
17 shouldBe("event.__proto__", "DeviceLightEvent.prototype");
19 shouldBeTrue("event instanceof window.DeviceLightEvent");
20 shouldBeTrue("'type' in event");
21 shouldBeTrue("'bubbles' in event");
22 shouldBeTrue("'cancelable' in event");
23 shouldBeTrue("'value' in event");
25 shouldBeTrue("typeof newEvent.type == 'string'");
26 shouldBeEqualToString("newEvent.type", "devicelight");
27 shouldBeTrue("typeof newEvent.bubbles == 'boolean'");
28 shouldBeTrue("newEvent.bubbles");
29 shouldBeTrue("typeof newEvent.cancelable == 'boolean'");
30 shouldBeFalse("newEvent.cancelable")
31 shouldBeTrue("typeof newEvent.value == 'number'");
32 shouldBeEqualToNumber('newEvent.value', 10);
34 // FIXME: Consider making bubbles property configurable.
35 shouldBeTrue("defaultEvent.bubbles");
36 shouldBeFalse("defaultEvent.cancelable");
37 </script>
38 </body>
39 </html>