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

Side by Side Diff: LayoutTests/inspector/device-orientation-success.html

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 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../http/tests/inspector/inspector-test.js"></script> 3 <script src="../http/tests/inspector/inspector-test.js"></script>
4 <script> 4 <script>
5 5
6 var mockAlpha = 1.1; 6 var mockAlpha = 1.1;
7 var mockBeta = 2.2; 7 var mockBeta = 2.2;
8 var mockGamma = 3.3; 8 var mockGamma = 3.3;
9 var absolute = true;
9 10
10 if (window.testRunner) 11 if (window.testRunner)
11 testRunner.setMockDeviceOrientation(true, mockAlpha, true, mockBeta, true, m ockGamma); 12 testRunner.setMockDeviceOrientation(true, mockAlpha, true, mockBeta, true, m ockGamma, true, absolute);
12 else 13 else
13 debug('This test can not be run without the LayoutTestController'); 14 debug('This test can not be run without the LayoutTestController');
14 15
15 function handler(evt) 16 function handler(evt)
16 { 17 {
17 console.log('alpha: ' + evt.alpha + ' beta: ' + evt.beta + ' gamma: ' + evt.gamma); 18 console.log('alpha: ' + evt.alpha + ' beta: ' + evt.beta + ' gamma: ' + evt.gamma);
18 } 19 }
19 20
20 function test() 21 function test()
21 { 22 {
22 function callback() 23 function callback()
23 { 24 {
24 PageAgent.clearDeviceOrientationOverride(); 25 PageAgent.clearDeviceOrientationOverride();
25 InspectorTest.completeTest(); 26 InspectorTest.completeTest();
26 } 27 }
27 28
28 InspectorTest.evaluateInPage("window.addEventListener('deviceorientation', h andler, false);", callback); 29 InspectorTest.evaluateInPage("window.addEventListener('deviceorientation', h andler, false);", callback);
29 PageAgent.setDeviceOrientationOverride(20, 30, 40); 30 PageAgent.setDeviceOrientationOverride(20, 30, 40);
30 } 31 }
31 </script> 32 </script>
32 </head> 33 </head>
33 <body onload="runTest()"> 34 <body onload="runTest()">
34 <p> 35 <p>
35 </p> 36 </p>
36 </body> 37 </body>
37 </html> 38 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698