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

Side by Side Diff: LayoutTests/inspector/screen-orientation-override.html

Issue 1220643002: Revert of [DevTools] Implement screen orientation override. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../http/tests/inspector/inspector-test.js"></script>
4 <script>
5
6 if (!window.testRunner)
7 debug("This test requires testRunner");
8
9 function dump()
10 {
11 return "angle: " + screen.orientation.angle + "; type: " + screen.orientatio n.type;
12 }
13
14 function setup()
15 {
16 if (window.testRunner)
17 testRunner.setMockScreenOrientation("landscape-primary");
18 return dump();
19 }
20
21 function test()
22 {
23 function testOverride(angle, orientation, next)
24 {
25 if (orientation) {
26 InspectorTest.ScreenOrientationAgent.setScreenOrientationOverride(ang le, orientation, protocolCallback);
27 } else {
28 InspectorTest.ScreenOrientationAgent.clearScreenOrientationOverride( protocolCallback);
29 }
30
31 function protocolCallback()
32 {
33 InspectorTest.evaluateInPage("dump()", dumpCallback);
34 }
35
36 function dumpCallback(result)
37 {
38 InspectorTest.addResult(result.value);
39 next();
40 }
41 }
42
43 function testError(angle, orientation, next)
44 {
45 InspectorTest.ScreenOrientationAgent.setScreenOrientationOverride(angle, orientation, protocolCallback);
46
47 function protocolCallback(error)
48 {
49 InspectorTest.addResult(error);
50 next();
51 }
52 }
53
54 InspectorTest.runTestSuite([
55 function setUp(next)
56 {
57 InspectorTest.evaluateInPage("setup()", callback);
58
59 function callback(result)
60 {
61 InspectorTest.addResult(result.value);
62 next();
63 }
64 },
65
66 function setWrongAngle1(next)
67 {
68 testError(-1, "portraitPrimary", next);
69 },
70
71 function setWrongAngle2(next)
72 {
73 testError(360, "portraitPrimary", next);
74 },
75
76 function setWrongType(next)
77 {
78 testError(120, "wrongType", next);
79 },
80
81 function setPortraitPrimary(next)
82 {
83 testOverride(0, "portraitPrimary", next);
84 },
85
86 function setPortraitSecondary(next)
87 {
88 testOverride(180, "portraitSecondary", next);
89 },
90
91 function setLandscapePrimary(next)
92 {
93 testOverride(90, "landscapePrimary", next);
94 },
95
96 function setLandscapeSecondary(next)
97 {
98 testOverride(270, "landscapeSecondary", next);
99 },
100
101 function clearOverride(next)
102 {
103 testOverride(0, "", next);
104 }
105 ]);
106 }
107 </script>
108 </head>
109 <body onload="runTest()">
110 <p>
111 </p>
112 </body>
113 </html>
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/inspector/inspector-test.js ('k') | LayoutTests/inspector/screen-orientation-override-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698