| OLD | NEW |
| 1 description('Tests the basic operation of DeviceOrientation using the mock.'); | 1 description('Tests the basic operation of DeviceOrientation using the mock.'); |
| 2 | 2 |
| 3 var mockAlpha = 1.1; | 3 var mockAlpha = 1.1; |
| 4 var mockBeta = 2.2; | 4 var mockBeta = 2.2; |
| 5 var mockGamma = 3.3; | 5 var mockGamma = 3.3; |
| 6 var mockAbsolute = true; |
| 6 | 7 |
| 7 if (window.testRunner) | 8 if (window.testRunner) |
| 8 testRunner.setMockDeviceOrientation(true, mockAlpha, true, mockBeta, true, m
ockGamma); | 9 testRunner.setMockDeviceOrientation(true, mockAlpha, true, mockBeta, true, m
ockGamma, true, mockAbsolute); |
| 9 else | 10 else |
| 10 debug('This test can not be run without the TestRunner'); | 11 debug('This test can not be run without the TestRunner'); |
| 11 | 12 |
| 12 var deviceOrientationEvent; | 13 var deviceOrientationEvent; |
| 13 window.addEventListener('deviceorientation', function(e) { | 14 window.addEventListener('deviceorientation', function(e) { |
| 14 deviceOrientationEvent = e; | 15 deviceOrientationEvent = e; |
| 15 shouldBe('deviceOrientationEvent.alpha', 'mockAlpha'); | 16 shouldBe('deviceOrientationEvent.alpha', 'mockAlpha'); |
| 16 shouldBe('deviceOrientationEvent.beta', 'mockBeta'); | 17 shouldBe('deviceOrientationEvent.beta', 'mockBeta'); |
| 17 shouldBe('deviceOrientationEvent.gamma', 'mockGamma'); | 18 shouldBe('deviceOrientationEvent.gamma', 'mockGamma'); |
| 19 shouldBe('deviceOrientationEvent.absolute', 'mockAbsolute'); |
| 18 finishJSTest(); | 20 finishJSTest(); |
| 19 }); | 21 }); |
| 20 | 22 |
| 21 window.jsTestIsAsync = true; | 23 window.jsTestIsAsync = true; |
| OLD | NEW |