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

Unified Diff: LayoutTests/inspector/console/console-search-reveals-messages.html

Issue 354013002: DevTools: [Console] fix search to reveal matched messages (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaseline one more test Created 6 years, 6 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 | LayoutTests/inspector/console/console-search-reveals-messages-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/inspector/console/console-search-reveals-messages.html
diff --git a/LayoutTests/inspector/console/console-search-reveals-messages.html b/LayoutTests/inspector/console/console-search-reveals-messages.html
new file mode 100644
index 0000000000000000000000000000000000000000..a106c25a13bd333480d73c729018d1f0a9e6d3ee
--- /dev/null
+++ b/LayoutTests/inspector/console/console-search-reveals-messages.html
@@ -0,0 +1,69 @@
+<html>
+<head>
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../http/tests/inspector/console-test.js"></script>
+<script>
+function populateConsoleWithMessages()
+{
+ for (var i = 0; i < 200; ++i)
+ console.log("Message #" + i);
+ console.log("LAST MESSAGE");
+ runTest();
+}
+
+function test()
+{
+ var consoleView = WebInspector.ConsolePanel._view();
+ var viewport = consoleView._viewport;
+ const maximumViewportMessagesCount = 150;
+ InspectorTest.runTestSuite([
+ function verifyViewportIsTallEnough(next)
+ {
+ viewport.invalidate();
+ var viewportMessagesCount = viewport._lastVisibleIndex - viewport._firstVisibleIndex;
+ if (viewportMessagesCount > maximumViewportMessagesCount) {
+ InspectorTest.addResult(String.sprintf("Test cannot be run because viewport could fit %d messages which is more then maxiumum of %d.", viewportMessagesCount, maximumViewportMessagesCount));
+ InspectorTest.completeTest();
+ return;
+ }
+ next();
+ },
+
+ function scrollConsoleToTop(next)
+ {
+ viewport.forceScrollItemToBeFirst(0);
+ viewport.refresh();
+ dumpTop();
+ next();
+ },
+
+ function testFindLastMessage(next)
+ {
+ consoleView._searchableView._searchInputElement.value = "LAST MESSAGE";
+ consoleView._searchableView.showSearchField();
+ consoleView._searchableView.handleFindNextShortcut();
+ dumpBottom();
+ next();
+ }
+ ]);
+
+ function dumpTop()
+ {
+ viewport.refresh();
+ InspectorTest.addResult("first visible message index: " + viewport.firstVisibleIndex());
+ }
+
+ function dumpBottom()
+ {
+ viewport.refresh();
+ InspectorTest.addResult("last visible message index: " + viewport.lastVisibleIndex());
+ }
+}
+</script>
+</head>
+<body onload="populateConsoleWithMessages()">
+<p>
+ Tests that console viewport reveals messages on searching.
+</p>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/inspector/console/console-search-reveals-messages-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698