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

Unified Diff: third_party/WebKit/LayoutTests/inspector/console/console-focus.html

Issue 2840663002: DevTools: clicking in console messages should not jump to bottom (Closed)
Patch Set: test Created 3 years, 8 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
Index: third_party/WebKit/LayoutTests/inspector/console/console-focus.html
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-focus.html b/third_party/WebKit/LayoutTests/inspector/console/console-focus.html
new file mode 100644
index 0000000000000000000000000000000000000000..ad6419394fc937cc1f6718e1b878aa9e62e0256a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/console/console-focus.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 logToConsole()
+{
+ console.log({a: 1});
+ for (var i = 0; i < 50; i++)
+ console.log(i);
+}
+
+var test = function()
+{
+ InspectorTest.fixConsoleViewportDimensions(600, 200);
+ InspectorTest.waitForConsoleMessages(52, step1);
+ InspectorTest.evaluateInConsole("logToConsole()");
+ var consoleView = Console.ConsoleView.instance();
+ var viewport = consoleView._viewport;
+
+ function step1()
+ {
+ viewport.invalidate();
+ viewport.forceScrollItemToBeFirst(0);
+ dumpScrollTop();
+
+ var previewElement = consoleView._visibleViewMessages[1].element().querySelector('.console-object-preview');
+ var previewRect = previewElement.getBoundingClientRect();
+ var clientX = previewRect.left + previewRect.width / 2;
+ var clientY = previewRect.top + previewRect.height / 2;
+
+ InspectorTest.addResult('Expanding object.');
+ previewElement.dispatchEvent(new MouseEvent('click', {clientX, clientY}));
+
+ viewport.refresh();
+ dumpScrollTop();
+ InspectorTest.completeTest();
+ }
+
+ function dumpScrollTop()
+ {
+ InspectorTest.addResult("Is at bottom: " + viewport.element.isScrolledToBottom() + ", should stick: " + viewport.stickToBottom());
+ }
+}
+
+</script>
+</head>
+
+<body onload="runTest()">
+<p>
+Tests that interacting with the console gives appropriate focus.
+</p>
+
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698