Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <script src="../../../resources/js-test.js"></script> | |
|
Inactive
2014/05/09 13:12:47
nit: this can be moved to the body and you can rem
riju_
2014/05/09 13:45:35
Done.
| |
| 5 </head> | |
| 6 <body> | |
| 7 <script> | |
| 8 description("Tests that document.createEvent() works with DeviceLightEvent."); | |
| 9 | |
| 10 var event = document.createEvent('DeviceLightEvent'); | |
| 11 var newEvent = new DeviceLightEvent("devicelight", { | |
| 12 bubbles: true, cancelable: false, | |
| 13 value: 10 | |
| 14 }); | |
| 15 | |
| 16 var defaultEvent = new DeviceLightEvent("devicelight"); | |
| 17 | |
| 18 shouldBeTrue("typeof event == 'object'"); | |
| 19 shouldBe("event.__proto__", "DeviceLightEvent.prototype"); | |
| 20 | |
| 21 shouldBeTrue("event instanceof window.DeviceLightEvent"); | |
| 22 shouldBeTrue("'type' in event"); | |
| 23 shouldBeTrue("'bubbles' in event"); | |
| 24 shouldBeTrue("'cancelable' in event"); | |
| 25 shouldBeTrue("'value' in event"); | |
| 26 | |
| 27 shouldBeTrue("typeof newEvent.type == 'string'"); | |
| 28 shouldBeEqualToString("newEvent.type", "devicelight"); | |
| 29 shouldBeTrue("typeof newEvent.bubbles == 'boolean'"); | |
| 30 shouldBeTrue("newEvent.bubbles"); | |
| 31 shouldBeTrue("typeof newEvent.cancelable == 'boolean'"); | |
| 32 shouldBeFalse("newEvent.cancelable") | |
| 33 shouldBeTrue("typeof newEvent.value == 'number'"); | |
| 34 shouldBeEqualToNumber('newEvent.value', 10); | |
| 35 | |
| 36 shouldBeTrue("defaultEvent.bubbles"); | |
| 37 shouldBeFalse("defaultEvent.cancelable"); | |
| 38 </script> | |
| 39 </body> | |
| 40 </html> | |
| OLD | NEW |