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

Side by Side 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 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
7 function logToConsole()
8 {
9 console.log({a: 1});
10 for (var i = 0; i < 50; i++)
11 console.log(i);
12 }
13
14 var test = function()
15 {
16 InspectorTest.fixConsoleViewportDimensions(600, 200);
17 InspectorTest.waitForConsoleMessages(52, step1);
18 InspectorTest.evaluateInConsole("logToConsole()");
19 var consoleView = Console.ConsoleView.instance();
20 var viewport = consoleView._viewport;
21
22 function step1()
23 {
24 viewport.invalidate();
25 viewport.forceScrollItemToBeFirst(0);
26 dumpScrollTop();
27
28 var previewElement = consoleView._visibleViewMessages[1].element().query Selector('.console-object-preview');
29 var previewRect = previewElement.getBoundingClientRect();
30 var clientX = previewRect.left + previewRect.width / 2;
31 var clientY = previewRect.top + previewRect.height / 2;
32
33 InspectorTest.addResult('Expanding object.');
34 previewElement.dispatchEvent(new MouseEvent('click', {clientX, clientY}) );
35
36 viewport.refresh();
37 dumpScrollTop();
38 InspectorTest.completeTest();
39 }
40
41 function dumpScrollTop()
42 {
43 InspectorTest.addResult("Is at bottom: " + viewport.element.isScrolledTo Bottom() + ", should stick: " + viewport.stickToBottom());
44 }
45 }
46
47 </script>
48 </head>
49
50 <body onload="runTest()">
51 <p>
52 Tests that interacting with the console gives appropriate focus.
53 </p>
54
55 </body>
56 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698