| OLD | NEW |
| 1 description('Tests the optional properties of DeviceOrientationEvent. Each prope
rty should be null if not set, or set to null or undefined.'); | 1 description('Tests the optional properties of DeviceOrientationEvent. Each prope
rty should be null if not set, or set to null or undefined.'); |
| 2 | 2 |
| 3 var event; | 3 var event; |
| 4 | 4 |
| 5 evalAndLog("event = document.createEvent('DeviceOrientationEvent')"); | 5 evalAndLog("event = document.createEvent('DeviceOrientationEvent')"); |
| 6 shouldBeTrue("event.alpha == null"); | 6 shouldBeTrue("event.alpha == null"); |
| 7 shouldBeTrue("event.beta == null"); | 7 shouldBeTrue("event.beta == null"); |
| 8 shouldBeTrue("event.gamma == null"); | 8 shouldBeTrue("event.gamma == null"); |
| 9 shouldBeTrue("event.absolute == null"); |
| 9 | 10 |
| 10 evalAndLog("event.initDeviceOrientationEvent('', false, false, 0, 1, 2)"); | 11 evalAndLog("event.initDeviceOrientationEvent('', false, false, 0, 1, 2)"); |
| 11 shouldBeTrue("event.alpha == 0"); | 12 shouldBeTrue("event.alpha == 0"); |
| 12 shouldBeTrue("event.beta == 1"); | 13 shouldBeTrue("event.beta == 1"); |
| 13 shouldBeTrue("event.gamma == 2"); | 14 shouldBeTrue("event.gamma == 2"); |
| 14 | 15 |
| 16 evalAndLog("event.initDeviceOrientationEvent('', false, false, 0, 1, 2, true)"); |
| 17 shouldBeTrue("event.alpha == 0"); |
| 18 shouldBeTrue("event.beta == 1"); |
| 19 shouldBeTrue("event.gamma == 2"); |
| 20 shouldBeTrue("event.absolute"); |
| 21 |
| 15 evalAndLog("event.initDeviceOrientationEvent()"); | 22 evalAndLog("event.initDeviceOrientationEvent()"); |
| 16 shouldBeTrue("event.alpha == null"); | 23 shouldBeTrue("event.alpha == null"); |
| 17 shouldBeTrue("event.beta == null"); | 24 shouldBeTrue("event.beta == null"); |
| 18 shouldBeTrue("event.gamma == null"); | 25 shouldBeTrue("event.gamma == null"); |
| 19 | 26 |
| 20 evalAndLog("event.initDeviceOrientationEvent('', false, false, [], [], [])"); | 27 evalAndLog("event.initDeviceOrientationEvent('', false, false, [], [], [])"); |
| 21 shouldBeTrue("event.alpha == 0"); | 28 shouldBeTrue("event.alpha == 0"); |
| 22 shouldBeTrue("event.beta == 0"); | 29 shouldBeTrue("event.beta == 0"); |
| 23 shouldBeTrue("event.gamma == 0"); | 30 shouldBeTrue("event.gamma == 0"); |
| 24 | 31 |
| 25 evalAndLog("event.initDeviceOrientationEvent('', false, false, undefined, undefi
ned, undefined)"); | 32 evalAndLog("event.initDeviceOrientationEvent('', false, false, undefined, undefi
ned, undefined)"); |
| 26 shouldBeTrue("event.alpha == null"); | 33 shouldBeTrue("event.alpha == null"); |
| 27 shouldBeTrue("event.beta == null"); | 34 shouldBeTrue("event.beta == null"); |
| 28 shouldBeTrue("event.gamma == null"); | 35 shouldBeTrue("event.gamma == null"); |
| 29 | 36 |
| 30 evalAndLog("event.initDeviceOrientationEvent('', false, false, '', '', '')"); | 37 evalAndLog("event.initDeviceOrientationEvent('', false, false, '', '', '')"); |
| 31 shouldBeTrue("event.alpha == 0"); | 38 shouldBeTrue("event.alpha == 0"); |
| 32 shouldBeTrue("event.beta == 0"); | 39 shouldBeTrue("event.beta == 0"); |
| 33 shouldBeTrue("event.gamma == 0"); | 40 shouldBeTrue("event.gamma == 0"); |
| 34 | 41 |
| 35 evalAndLog("event.initDeviceOrientationEvent('', false, false, null, null, null)
"); | 42 evalAndLog("event.initDeviceOrientationEvent('', false, false, null, null, null)
"); |
| 36 shouldBeTrue("event.alpha == null"); | 43 shouldBeTrue("event.alpha == null"); |
| 37 shouldBeTrue("event.beta == null"); | 44 shouldBeTrue("event.beta == null"); |
| 38 shouldBeTrue("event.gamma == null"); | 45 shouldBeTrue("event.gamma == null"); |
| OLD | NEW |