summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/dom/DeviceOrientation/script-tests/basic-operation.js
blob: 6e68b06b8ccc9cf84cde998f9fa20e2105198cec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
description("Tests the basic operation of DeviceOrientation using the mock.");

var mockAlpha = 1.1;
var mockBeta = 2.2;
var mockGamma = 3.3;

if (window.layoutTestController)
    layoutTestController.setMockDeviceOrientation(true, mockAlpha, true, mockBeta, true, mockGamma);
else
    debug('This test can not be run without the LayoutTestController');

var deviceOrientationEvent;
window.addEventListener("deviceorientation", function(e) {
    deviceOrientationEvent = e;
    shouldBe('deviceOrientationEvent.alpha', 'mockAlpha');
    shouldBe('deviceOrientationEvent.beta', 'mockBeta');
    shouldBe('deviceOrientationEvent.gamma', 'mockGamma');
    finishJSTest();
});

window.jsTestIsAsync = true;
window.successfullyParsed = true;