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

Side by Side Diff: LayoutTests/inspector/console/console-viewport-selection.html

Issue 399753003: DevTools: fix inspector/console/console-viewport-selection.html flakiness (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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
« no previous file with comments | « no previous file | LayoutTests/inspector/console/console-viewport-selection-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 src="../../http/tests/inspector/console-test.js"></script> 4 <script src="../../http/tests/inspector/console-test.js"></script>
5 <script> 5 <script>
6 function populateConsoleWithMessages(count) 6 function populateConsoleWithMessages(count)
7 { 7 {
8 for (var i = 0; i < count; ++i) 8 for (var i = 0; i < count; ++i)
9 console.log("Message #" + i); 9 console.log("Message #" + i);
10 } 10 }
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 return null; 219 return null;
220 } 220 }
221 221
222 function selectMessages(fromMessage, fromTextOffset, toMessage, toTextOffset ) 222 function selectMessages(fromMessage, fromTextOffset, toMessage, toTextOffset )
223 { 223 {
224 if (Math.abs(toMessage - fromMessage) > minimumViewportMessagesCount) { 224 if (Math.abs(toMessage - fromMessage) > minimumViewportMessagesCount) {
225 InspectorTest.addResult(String.sprintf("FAILURE: Cannot select more then %d messages (requested to select from %d to %d", minimumViewportMessagesCou nt, fromMessage, toMessage)); 225 InspectorTest.addResult(String.sprintf("FAILURE: Cannot select more then %d messages (requested to select from %d to %d", minimumViewportMessagesCou nt, fromMessage, toMessage));
226 InspectorTest.completeTest(); 226 InspectorTest.completeTest();
227 return; 227 return;
228 } 228 }
229 viewport.forceScrollItemToBeLast(Math.max(fromMessage, toMessage)); 229 viewport.forceScrollItemToBeFirst(Math.min(fromMessage, toMessage));
230 230
231 var from = selectionContainerAndOffset(consoleView.itemElement(fromMessa ge).element(), fromTextOffset); 231 var from = selectionContainerAndOffset(consoleView.itemElement(fromMessa ge).element(), fromTextOffset);
232 var to = selectionContainerAndOffset(consoleView.itemElement(toMessage). element(), toTextOffset); 232 var to = selectionContainerAndOffset(consoleView.itemElement(toMessage). element(), toTextOffset);
233 window.getSelection().setBaseAndExtent(from.container, from.offset, to.c ontainer, to.offset); 233 window.getSelection().setBaseAndExtent(from.container, from.offset, to.c ontainer, to.offset);
234 viewport.refresh(); 234 viewport.refresh();
235 } 235 }
236 } 236 }
237 </script> 237 </script>
238 </head> 238 </head>
239 <body onload="runTest()"> 239 <body onload="runTest()">
240 <p> 240 <p>
241 Tests that console viewport handles selection properly. 241 Tests that console viewport handles selection properly.
242 </p> 242 </p>
243 </body> 243 </body>
244 </html> 244 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector/console/console-viewport-selection-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698