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

Side by Side Diff: LayoutTests/inspector/console/console-search-can-jump-forward-between-tree-element-matches.html

Issue 676193002: Navigate between individual search matches in DevTools console (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Add tests Created 6 years, 1 month 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
(Empty)
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/console-test.js"></script>
5 <script>
6 function populateConsoleWithMessages()
7 {
8 console.dir(window);
9 runTest();
10 }
11
12 function test()
13 {
14 function addResult(result)
15 {
16 viewport.refresh();
17 InspectorTest.addResult(result);
18 }
19
20 // Make sure to produce test output in case test times out
21 setTimeout(InspectorTest.completeTest.bind(InspectorTest), 2000);
22
23 var consoleView = WebInspector.ConsolePanel._view();
24 var viewport = consoleView._viewport;
25 const maximumViewportMessagesCount = 150;
26 InspectorTest.runTestSuite([
27 function assertViewportHeight(next)
28 {
29 viewport.invalidate();
30 var viewportMessagesCount = viewport._lastVisibleIndex - viewport._f irstVisibleIndex;
31 if (viewportMessagesCount > maximumViewportMessagesCount) {
32 InspectorTest.addResult(String.sprintf(
33 "Test cannot be run because viewport can fit %d messages, wh ile %d is the test's maximum.",
34 viewportMessagesCount, maximumViewportMessagesCount));
35 InspectorTest.completeTest();
36 return;
37 }
38 next();
39 },
40
41 function scrollConsoleToTop(next)
42 {
43 viewport.forceScrollItemToBeFirst(0);
44 addResult("first visible message index: " + viewport.firstVisibleInd ex());
45 next();
46 },
47
48 function testFindMatches(next)
49 {
50 InspectorTest.expandConsoleMessages(function()
51 {
52 consoleView._searchableView._searchInputElement.value = "HTML";
53 consoleView._searchableView.showSearchField();
54
55 // Find first match
56 consoleView._searchableView.handleFindNextShortcut();
57 // XXX: How to output currently matched tree element?
58
59 // Find second match
60 consoleView._searchableView.handleFindNextShortcut();
61 // XXX: How to output currently matched tree element?
62
63 next();
64 });
65 }
66 ]);
67 }
68 </script>
69 </head>
70 <body onload="populateConsoleWithMessages()">
71 <p>
72 Tests that console can jump forward between search matches in tree elements.
73 </p>
74 </body>
75 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698