OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <html> | |
3 <body> | |
4 <script src="../../../resources/js-test.js"></script> | |
5 <script> | |
6 description('Tests the optional properties of DeviceOrientationEvent. Each prope
rty should be null if not set, or set to null or undefined.'); | |
7 | |
8 var event; | |
9 | |
10 evalAndLog("event = document.createEvent('DeviceOrientationEvent')"); | |
11 shouldBeTrue("event.alpha == null"); | |
12 shouldBeTrue("event.beta == null"); | |
13 shouldBeTrue("event.gamma == null"); | |
14 shouldBeFalse("event.absolute"); | |
15 | |
16 evalAndLog("event.initDeviceOrientationEvent('', false, false, 0, 1, 2, false)")
; | |
17 shouldBeTrue("event.alpha == 0"); | |
18 shouldBeTrue("event.beta == 1"); | |
19 shouldBeTrue("event.gamma == 2"); | |
20 shouldBeFalse("event.absolute"); | |
21 | |
22 evalAndLog("event.initDeviceOrientationEvent('', false, false, 0, 1, 2, true)"); | |
23 shouldBeTrue("event.alpha == 0"); | |
24 shouldBeTrue("event.beta == 1"); | |
25 shouldBeTrue("event.gamma == 2"); | |
26 shouldBeTrue("event.absolute"); | |
27 | |
28 evalAndLog("event.initDeviceOrientationEvent()"); | |
29 shouldBeTrue("event.alpha == null"); | |
30 shouldBeTrue("event.beta == null"); | |
31 shouldBeTrue("event.gamma == null"); | |
32 shouldBeFalse("event.absolute"); | |
33 | |
34 evalAndLog("event.initDeviceOrientationEvent('', false, false, [], [], [], [])")
; | |
35 shouldBeTrue("event.alpha == 0"); | |
36 shouldBeTrue("event.beta == 0"); | |
37 shouldBeTrue("event.gamma == 0"); | |
38 shouldBeTrue("event.absolute"); | |
39 | |
40 evalAndLog("event.initDeviceOrientationEvent('', false, false, undefined, undefi
ned, undefined, undefined)"); | |
41 shouldBeTrue("event.alpha == null"); | |
42 shouldBeTrue("event.beta == null"); | |
43 shouldBeTrue("event.gamma == null"); | |
44 shouldBeFalse("event.absolute"); | |
45 | |
46 evalAndLog("event.initDeviceOrientationEvent('', false, false, '', '', '', '')")
; | |
47 shouldBeTrue("event.alpha == 0"); | |
48 shouldBeTrue("event.beta == 0"); | |
49 shouldBeTrue("event.gamma == 0"); | |
50 shouldBeFalse("event.absolute"); | |
51 | |
52 evalAndLog("event.initDeviceOrientationEvent('', false, false, null, null, null,
null)"); | |
53 shouldBeTrue("event.alpha == null"); | |
54 shouldBeTrue("event.beta == null"); | |
55 shouldBeTrue("event.gamma == null"); | |
56 shouldBeFalse("event.absolute"); | |
57 </script> | |
58 </body> | |
59 </html> | |
OLD | NEW |