Index: LayoutTests/inspector/console/console-search-can-highlight-current-match.html |
diff --git a/LayoutTests/inspector/console/console-search-can-highlight-current-match.html b/LayoutTests/inspector/console/console-search-can-highlight-current-match.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e69e11342a3069600d1d03a6543928ad0fdc994a |
--- /dev/null |
+++ b/LayoutTests/inspector/console/console-search-can-highlight-current-match.html |
@@ -0,0 +1,56 @@ |
+<html> |
+<head> |
+<script src="../../http/tests/inspector/inspector-test.js"></script> |
+<script src="../../http/tests/inspector/console-test.js"></script> |
+<script> |
+function populateConsoleWithMessages() |
+{ |
+ console.log("FIRST MATCH"); |
+ console.log("SECOND MATCH"); |
+ runTest(); |
+} |
+ |
+function test() |
+{ |
+ function addResult(result) |
+ { |
+ viewport.refresh(); |
+ InspectorTest.addResult(result); |
+ } |
+ |
+ // Make sure to produce test output in case test times out |
+ setTimeout(InspectorTest.completeTest.bind(InspectorTest), 2000); |
lushnikov
2014/11/07 16:27:16
We do not commit these lines - just use them to de
aknudsen
2014/11/08 12:00:52
Ah OK.
aknudsen
2014/11/09 00:02:12
Done.
|
+ |
+ var consoleView = WebInspector.ConsolePanel._view(); |
+ var viewport = consoleView._viewport; |
+ InspectorTest.runTestSuite([ |
+ function scrollConsoleToTop(next) |
+ { |
+ viewport.forceScrollItemToBeFirst(0); |
+ addResult("first visible message index: " + viewport.firstVisibleIndex()); |
+ next(); |
+ }, |
+ |
+ function testMarkCurrentMatch(next) |
+ { |
+ consoleView._searchableView._searchInputElement.value = "MATCH"; |
+ consoleView._searchableView.showSearchField(); |
+ |
+ // Find first match |
+ consoleView._searchableView.handleFindNextShortcut(); |
+ addResult(InspectorTest.dumpConsoleMessagesIntoArray(false, true)); |
+ |
+ // Find second match |
+ consoleView._searchableView.handleFindNextShortcut(); |
+ addResult(InspectorTest.dumpConsoleMessagesIntoArray(false, true)); |
+ } |
lushnikov
2014/11/07 16:27:16
you don't call "next()" in the end of the function
aknudsen
2014/11/08 12:00:52
Acknowledged.
aknudsen
2014/11/09 00:02:12
Done.
|
+ ]); |
+} |
+</script> |
+</head> |
+<body onload="populateConsoleWithMessages()"> |
+<p> |
+ Tests that console can highlight the current search match. |
+</p> |
+</body> |
+</html> |