| <html> |
| <head> |
| <script src="../http/tests/inspector/inspector-test.js"></script> |
| <script> |
| |
| var mockAlpha = 1.1; |
| var mockBeta = 2.2; |
| var mockGamma = 3.3; |
| var absolute = true; |
| |
| if (!window.testRunner) |
| debug("This test requires testRunner"); |
| |
| function setup() |
| { |
| if (window.testRunner) |
| testRunner.setMockDeviceOrientation(true, mockAlpha, true, mockBeta, true, mockGamma, absolute); |
| window.addEventListener("deviceorientation", handler, false); |
| } |
| |
| function handler(evt) |
| { |
| console.log("alpha: " + evt.alpha + " beta: " + evt.beta + " gamma: " + evt.gamma); |
| } |
| |
| function test() |
| { |
| InspectorTest.runTestSuite([ |
| function setUp(next) |
| { |
| InspectorTest.evaluateInPage("setup()", next); |
| }, |
| |
| function setOverride(next) |
| { |
| InspectorTest.addConsoleSniffer(next); |
| InspectorTest.DeviceOrientationAgent.setDeviceOrientationOverride(20, 30, 40); |
| }, |
| |
| function clearOverride(next) |
| { |
| InspectorTest.DeviceOrientationAgent.clearDeviceOrientationOverride(next); |
| } |
| ]); |
| } |
| </script> |
| </head> |
| <body onload="runTest()"> |
| <p> |
| </p> |
| </body> |
| </html> |