Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / screen-orientation-override.html
blob11bf460764e2d1a18ac3e1cf144028d06accf05f
1 <html>
2 <head>
3 <script src="../http/tests/inspector/inspector-test.js"></script>
4 <script>
6 if (!window.testRunner)
7 debug("This test requires testRunner");
9 function dump()
11 return "angle: " + screen.orientation.angle + "; type: " + screen.orientation.type;
14 if (window.testRunner)
15 testRunner.setMockScreenOrientation("landscape-primary");
17 function test()
19 function addDumpResult(next)
21 InspectorTest.evaluateInPage("dump()", dumpCallback);
23 function dumpCallback(result)
25 InspectorTest.addResult(result.value);
26 next();
30 function testOverride(angle, orientation, next)
32 var protocolCallback = addDumpResult.bind(null, next);
33 if (orientation) {
34 InspectorTest.ScreenOrientationAgent.setScreenOrientationOverride(angle, orientation, protocolCallback);
35 } else {
36 InspectorTest.ScreenOrientationAgent.clearScreenOrientationOverride(protocolCallback);
40 function testError(angle, orientation, next)
42 InspectorTest.ScreenOrientationAgent.setScreenOrientationOverride(angle, orientation, protocolCallback);
44 function protocolCallback(error)
46 InspectorTest.addResult(error);
47 next();
51 InspectorTest.runTestSuite([
52 function initial(next)
54 addDumpResult(next);
57 function setWrongAngle1(next)
59 testError(-1, "portraitPrimary", next);
62 function setWrongAngle2(next)
64 testError(360, "portraitPrimary", next);
67 function setWrongType(next)
69 testError(120, "wrongType", next);
72 function setPortraitPrimary(next)
74 testOverride(0, "portraitPrimary", next);
77 function setPortraitSecondary(next)
79 testOverride(180, "portraitSecondary", next);
82 function setLandscapePrimary(next)
84 testOverride(90, "landscapePrimary", next);
87 function restoresAfterReload(next)
89 InspectorTest.reloadPage(addDumpResult.bind(null, next));
92 function setLandscapeSecondary(next)
94 testOverride(270, "landscapeSecondary", next);
97 function clearOverride(next)
99 testOverride(0, "", next);
103 </script>
104 </head>
105 <body onload="runTest()">
107 </p>
108 </body>
109 </html>