| OLD | NEW |
| 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> |
| OLD | NEW |