| 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>
|
|
|