Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: LayoutTests/fast/dom/DeviceOrientation/script-tests/basic-operation.js

Issue 22599005: Blink-side layout tests for the new Device Orientation API. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased once more Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698