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