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

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

Issue 2803233003: [DevTools] Make screen-orientation-override agnostic to real screen orientation (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/screen-orientation-override-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 if (window.testRunner) 6 if (window.testRunner) {
7 window.testRunner.disableMockScreenOrientation(); 7 window.testRunner.disableMockScreenOrientation();
8 window.testRunner.setDumpConsoleMessages(false);
9 }
8 10
9 var windowOrientationChangeEvent = false; 11 var windowOrientationChangeEvent = false;
10 var screenOrientationChangeEvent = false; 12 var screenOrientationChangeEvent = false;
11 13
12 window.addEventListener("orientationchange", function() { windowOrientationChang eEvent = true; maybeLog(); }); 14 window.addEventListener("orientationchange", function() { windowOrientationChang eEvent = true; maybeLog(); });
13 screen.orientation.addEventListener("change", function() { screenOrientationChan geEvent = true; maybeLog(); }); 15 screen.orientation.addEventListener("change", function() { screenOrientationChan geEvent = true; maybeLog(); });
14 16
15 function dump() 17 function dump()
16 { 18 {
17 return "angle: " + screen.orientation.angle + "; type: " + screen.orientatio n.type; 19 return "angle: " + screen.orientation.angle + "; type: " + screen.orientatio n.type;
18 } 20 }
19 21
20 function maybeLog() 22 function maybeLog()
21 { 23 {
22 if (windowOrientationChangeEvent && screenOrientationChangeEvent) { 24 if (windowOrientationChangeEvent && screenOrientationChangeEvent) {
23 windowOrientationChangeEvent = false; 25 windowOrientationChangeEvent = false;
24 screenOrientationChangeEvent = false; 26 screenOrientationChangeEvent = false;
25 console.log(dump()); 27 console.log(dump());
lushnikov 2017/04/07 22:19:46 can we rather kill this all logic for dumping?
dgozman 2017/04/07 22:29:05 Sounds like extra movement for no benefit.
26 } 28 }
27 } 29 }
28 30
29 function test() 31 function test()
30 { 32 {
31 Protocol.InspectorBackend.Options.suppressRequestErrors = false; 33 Protocol.InspectorBackend.Options.suppressRequestErrors = false;
32 function addDumpResult(next) 34 function addDumpResult(next)
33 { 35 {
34 InspectorTest.evaluateInPage("dump()", dumpCallback); 36 InspectorTest.evaluateInPage("dump()", dumpCallback);
35 37
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 } 124 }
123 ]); 125 ]);
124 } 126 }
125 </script> 127 </script>
126 </head> 128 </head>
127 <body onload="runTest()"> 129 <body onload="runTest()">
128 <p> 130 <p>
129 </p> 131 </p>
130 </body> 132 </body>
131 </html> 133 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/screen-orientation-override-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698