| Index: LayoutTests/inspector/console/console-search-can-jump-forward-between-tree-element-matches.html
|
| diff --git a/LayoutTests/inspector/console/console-search-can-jump-forward-between-tree-element-matches.html b/LayoutTests/inspector/console/console-search-can-jump-forward-between-tree-element-matches.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..4eb62d3db065419899fa609702bd380e9941c414
|
| --- /dev/null
|
| +++ b/LayoutTests/inspector/console/console-search-can-jump-forward-between-tree-element-matches.html
|
| @@ -0,0 +1,75 @@
|
| +<html>
|
| +<head>
|
| +<script src="../../http/tests/inspector/inspector-test.js"></script>
|
| +<script src="../../http/tests/inspector/console-test.js"></script>
|
| +<script>
|
| +function populateConsoleWithMessages()
|
| +{
|
| + console.dir(window);
|
| + 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);
|
| +
|
| + var consoleView = WebInspector.ConsolePanel._view();
|
| + var viewport = consoleView._viewport;
|
| + const maximumViewportMessagesCount = 150;
|
| + InspectorTest.runTestSuite([
|
| + function assertViewportHeight(next)
|
| + {
|
| + viewport.invalidate();
|
| + var viewportMessagesCount = viewport._lastVisibleIndex - viewport._firstVisibleIndex;
|
| + if (viewportMessagesCount > maximumViewportMessagesCount) {
|
| + InspectorTest.addResult(String.sprintf(
|
| + "Test cannot be run because viewport can fit %d messages, while %d is the test's maximum.",
|
| + viewportMessagesCount, maximumViewportMessagesCount));
|
| + InspectorTest.completeTest();
|
| + return;
|
| + }
|
| + next();
|
| + },
|
| +
|
| + function scrollConsoleToTop(next)
|
| + {
|
| + viewport.forceScrollItemToBeFirst(0);
|
| + addResult("first visible message index: " + viewport.firstVisibleIndex());
|
| + next();
|
| + },
|
| +
|
| + function testFindMatches(next)
|
| + {
|
| + InspectorTest.expandConsoleMessages(function()
|
| + {
|
| + consoleView._searchableView._searchInputElement.value = "HTML";
|
| + consoleView._searchableView.showSearchField();
|
| +
|
| + // Find first match
|
| + consoleView._searchableView.handleFindNextShortcut();
|
| + // XXX: How to output currently matched tree element?
|
| +
|
| + // Find second match
|
| + consoleView._searchableView.handleFindNextShortcut();
|
| + // XXX: How to output currently matched tree element?
|
| +
|
| + next();
|
| + });
|
| + }
|
| + ]);
|
| +}
|
| +</script>
|
| +</head>
|
| +<body onload="populateConsoleWithMessages()">
|
| +<p>
|
| + Tests that console can jump forward between search matches in tree elements.
|
| +</p>
|
| +</body>
|
| +</html>
|
|
|