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