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 83909bd6f1cfabe456ce40d4bc76d8cdf395b10d..f6a6e66ef53d1b59019d67ff3fa9467e3ef6a3ff 100644 |
--- a/third_party/WebKit/LayoutTests/inspector/console/console-viewport-selection.html |
+++ b/third_party/WebKit/LayoutTests/inspector/console/console-viewport-selection.html |
@@ -259,23 +259,6 @@ function test() |
viewport.refresh(); |
} |
- function selectionContainerAndOffset(container, offset) |
- { |
- var charCount = 0; |
- var node = container; |
- while (node = node.traverseNextTextNode(true)) { |
- var length = node.textContent.length; |
- if (charCount + length >= offset) { |
- return { |
- container: node, |
- offset: offset - charCount |
- }; |
- } |
- charCount += length; |
- } |
- return null; |
- } |
- |
function selectMessages(fromMessage, fromTextOffset, toMessage, toTextOffset) |
{ |
if (Math.abs(toMessage - fromMessage) > minimumViewportMessagesCount) { |
@@ -285,9 +268,7 @@ function test() |
} |
viewport.forceScrollItemToBeFirst(Math.min(fromMessage, toMessage)); |
- var from = selectionContainerAndOffset(consoleView.itemElement(fromMessage).element(), fromTextOffset); |
- var to = selectionContainerAndOffset(consoleView.itemElement(toMessage).element(), toTextOffset); |
- window.getSelection().setBaseAndExtent(from.container, from.offset, to.container, to.offset); |
+ InspectorTest.selectConsoleMessages(fromMessage, fromTextOffset, toMessage, toTextOffset); |
viewport.refresh(); |
} |
} |