OLD | NEW |
1 // This test can be used to test device orientation event types: 'deviceorientat
ion' and 'deviceorientationabsolute'. | 1 // This test can be used to test device orientation event types: 'deviceorientat
ion' and 'deviceorientationabsolute'. |
2 function testBasicOperation(eventType) { | 2 function testBasicOperation(eventType) { |
3 window.jsTestIsAsync = true; | 3 window.jsTestIsAsync = true; |
4 if (!window.testRunner) | 4 if (!window.testRunner) |
5 debug('This test can not be run without the TestRunner'); | 5 debug('This test can not be run without the TestRunner'); |
6 | 6 |
7 mockAlpha = 1.1; | 7 mockAlpha = 1.1; |
8 mockBeta = 2.2; | 8 mockBeta = 2.2; |
9 mockGamma = 3.3; | 9 mockGamma = 3.3; |
10 mockAbsolute = true; | 10 mockAbsolute = true; |
11 testRunner.setMockDeviceOrientation(true, mockAlpha, true, mockBeta, true, m
ockGamma, mockAbsolute); | 11 testRunner.setMockDeviceOrientation(true, mockAlpha, true, mockBeta, true, m
ockGamma, mockAbsolute); |
12 | 12 |
13 window.addEventListener(eventType, function(e) { | 13 window.addEventListener(eventType, function(e) { |
14 event = e; | 14 event = e; |
15 shouldBe('event.alpha', 'mockAlpha'); | 15 shouldBe('event.alpha', 'mockAlpha'); |
16 shouldBe('event.beta', 'mockBeta'); | 16 shouldBe('event.beta', 'mockBeta'); |
17 shouldBe('event.gamma', 'mockGamma'); | 17 shouldBe('event.gamma', 'mockGamma'); |
18 shouldBe('event.absolute', 'mockAbsolute'); | 18 shouldBe('event.absolute', 'mockAbsolute'); |
19 finishJSTest(); | 19 finishJSTest(); |
20 }); | 20 }); |
21 } | 21 } |
OLD | NEW |