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

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

Issue 2340223002: DevTools: fix ViewportControl's text selection logic (Closed)
Patch Set: add test Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/console/console-viewport-selection-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/inspector/console/console-viewport-selection.html
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-viewport-selection.html b/third_party/WebKit/LayoutTests/inspector/console/console-viewport-selection.html
index 9f55b218195201437a393341c760c024230c4c0c..c991d790704d409814f96ecc1a36075efb3eb806 100644
--- a/third_party/WebKit/LayoutTests/inspector/console/console-viewport-selection.html
+++ b/third_party/WebKit/LayoutTests/inspector/console/console-viewport-selection.html
@@ -182,6 +182,27 @@ function test()
var count = text ? text.split("\n").length : 0;
InspectorTest.addResult(count === messagesCount ? "Selected all " + count + " messages." : "Selected " + count + " messages instead of " + messagesCount);
next();
+ },
+
+ function testSelectWithNonTextNodeContainer(next)
+ {
+ viewport.forceScrollItemToBeFirst(0);
+
+ var nonTextNodeBase = consoleView.itemElement(1).element();
+ var nonTextNodeExtent = consoleView.itemElement(2).element();
+ var textNodeBase = consoleView.itemElement(1).element().traverseNextTextNode();
+ var textNodeExtent = consoleView.itemElement(2).element().traverseNextTextNode();
+
+ window.getSelection().setBaseAndExtent(nonTextNodeBase, 0, nonTextNodeExtent, 0);
+ InspectorTest.addResult("Selected text: " + viewport._selectedText());
+
+ window.getSelection().setBaseAndExtent(textNodeBase, 0, nonTextNodeExtent, 0);
+ InspectorTest.addResult("Selected text: " + viewport._selectedText());
+
+ window.getSelection().setBaseAndExtent(nonTextNodeBase, 0, textNodeExtent, 0);
+ InspectorTest.addResult("Selected text: " + viewport._selectedText());
+
+ next();
}
];
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/console/console-viewport-selection-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698