Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(422)

Side by Side Diff: LayoutTests/fast/dom/DeviceLight/create-event.html

Issue 143823004: Implement DeviceLight (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Chris's comments Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698