| Index: third_party/WebKit/LayoutTests/fast/dom/DeviceOrientation/resources/basic-operation.js
|
| diff --git a/third_party/WebKit/LayoutTests/fast/dom/DeviceOrientation/resources/basic-operation.js b/third_party/WebKit/LayoutTests/fast/dom/DeviceOrientation/resources/basic-operation.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..951774c394ce86caed6d95771dc1b4d7732ae6e6
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/fast/dom/DeviceOrientation/resources/basic-operation.js
|
| @@ -0,0 +1,22 @@
|
| +// This test can be used to test device orientation event types: 'deviceorientation' and 'deviceorientationabsolute'.
|
| +function testBasicOperation(eventType) {
|
| + window.jsTestIsAsync = true;
|
| + if (!window.testRunner)
|
| + debug('This test can not be run without the TestRunner');
|
| +
|
| + mockAlpha = 1.1;
|
| + mockBeta = 2.2;
|
| + mockGamma = 3.3;
|
| + mockAbsolute = true;
|
| + testRunner.setMockDeviceOrientation(true, mockAlpha, true, mockBeta, true, mockGamma, true, mockAbsolute);
|
| +
|
| + window.addEventListener(eventType, function(e) {
|
| + event = e;
|
| + shouldBe('event.alpha', 'mockAlpha');
|
| + shouldBe('event.beta', 'mockBeta');
|
| + shouldBe('event.gamma', 'mockGamma');
|
| + shouldBe('event.absolute', 'mockAbsolute');
|
| + finishJSTest();
|
| + });
|
| +}
|
| +
|
|
|