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

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

Issue 2693813002: Selection API: Some functions should throw InvalidNodeTypeError and IndexSizeError. (Closed)
Patch Set: adjust 2 more tests Created 3 years, 10 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
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 - 1; ++i) 8 for (var i = 0; i < count - 1; ++i)
9 console.log("Message #" + i); 9 console.log("Message #" + i);
10 console.log("hello %cworld", "color: blue"); 10 console.log("hello %cworld", "color: blue");
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 154
155 function testZeroOffsetSelection(next) 155 function testZeroOffsetSelection(next)
156 { 156 {
157 viewport.forceScrollItemToBeLast(messagesCount - 1); 157 viewport.forceScrollItemToBeLast(messagesCount - 1);
158 var lastMessageElement = viewport.renderedElementAt(messagesCount - 1); 158 var lastMessageElement = viewport.renderedElementAt(messagesCount - 1);
159 // there is a blue-colored "world" span in last message. 159 // there is a blue-colored "world" span in last message.
160 var blueSpan = lastMessageElement; 160 var blueSpan = lastMessageElement;
161 while (blueSpan.nodeName !== "SPAN" || blueSpan.textContent !== "wor ld") 161 while (blueSpan.nodeName !== "SPAN" || blueSpan.textContent !== "wor ld")
162 blueSpan = blueSpan.traverseNextNode(); 162 blueSpan = blueSpan.traverseNextNode();
163 163
164 window.getSelection().setBaseAndExtent(blueSpan, 0, blueSpan, blueSp an.textContent.length); 164 window.getSelection().setBaseAndExtent(blueSpan, 0, blueSpan, blueSp an.childNodes.length);
165 InspectorTest.addResult("Selected text: " + viewport._selectedText() ); 165 InspectorTest.addResult("Selected text: " + viewport._selectedText() );
166 next(); 166 next();
167 }, 167 },
168 168
169 function testSelectAll(next) 169 function testSelectAll(next)
170 { 170 {
171 viewport.forceScrollItemToBeFirst(0); 171 viewport.forceScrollItemToBeFirst(0);
172 172
173 // Set some initial selection in console. 173 // Set some initial selection in console.
174 var base = consoleView.itemElement(messagesCount - 2).element(); 174 var base = consoleView.itemElement(messagesCount - 2).element();
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 } 292 }
293 } 293 }
294 </script> 294 </script>
295 </head> 295 </head>
296 <body onload="runTest()"> 296 <body onload="runTest()">
297 <p> 297 <p>
298 Tests that console viewport handles selection properly. 298 Tests that console viewport handles selection properly.
299 </p> 299 </p>
300 </body> 300 </body>
301 </html> 301 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698