Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / DeviceOrientation / create-event.html
blob1ee45d2fd0846ab6672b110e1f123e13cc1a1f2c
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 DeviceOrientationEvent.');
8 var event = document.createEvent('DeviceOrientationEvent');
9 var newEvent = new CustomEvent("deviceorientation", {
10 bubbles: false, cancelable: false,
11 alpha: 1.0,
12 beta: 2.0,
13 gama: 3.0,
14 absolute: false
15 });
17 shouldBeTrue("typeof event == 'object'");
18 shouldBe("event.__proto__", "DeviceOrientationEvent.prototype");
20 shouldBeTrue("'type' in event");
21 shouldBeTrue("'bubbles' in event");
22 shouldBeTrue("'cancelable' in event");
23 shouldBeTrue("'alpha' in event");
24 shouldBeTrue("'beta' in event");
25 shouldBeTrue("'gamma' in event");
26 shouldBeTrue("'absolute' in event");
28 shouldBeTrue("typeof event.type == 'string'");
29 shouldBeTrue("typeof event.bubbles == 'boolean'");
30 shouldBeTrue("typeof event.cancelable == 'boolean'");
31 shouldBeTrue("typeof event.alpha == 'object'");
32 shouldBeTrue("typeof event.beta == 'object'");
33 shouldBeTrue("typeof event.gamma == 'object'");
34 shouldBeTrue("typeof event.absolute == 'object'");
36 shouldBeEqualToString("newEvent.type", "deviceorientation");
37 shouldBeFalse("newEvent.bubbles");
38 shouldBeFalse("newEvent.cancelable");
40 </script>
41 </body>
42 </html>