Commit 89b99696 authored by Simon Zünd's avatar Simon Zünd Committed by Commit Bot

Prepare remaining console web tests for asynchronous source mapping

This CL adds async/await to the remaining web tests in
http/tests/devtools/console for the upcoming source map asyncification.

The CL also adds a few live location sync points where necessary. This
generally happens right after console message rendering is triggered.
Before the console message is logged, all pending live location
updates need to be {await}ed, as these will happen asynchronous in
the future.

Note: console-uncaught-promise.js is re-baselined as the test output
contains a stack trace with a frame from the test script itself.
As the test moves around some code, we also require a new baseline
reflecting those changes.

Bug: chromium:1032016
Change-Id: I57e5708038f4978b903080e5699afcab4e3f5b05
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2066856
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: default avatarMathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#743914}
parent 445d777b
......@@ -20,11 +20,13 @@
var consoleView = Console.ConsoleView.instance();
var viewport = consoleView._viewport;
TestRunner.runTestSuite([function testSelectAll(next) {
TestRunner.runTestSuite([async function testSelectAll(next) {
viewport.forceScrollItemToBeFirst(0);
// Set some initial selection in console.
var base = consoleView.itemElement(0).element();
// Console messages contain live locations.
await TestRunner.waitForPendingLiveLocationUpdates();
window.getSelection().setBaseAndExtent(base, 0, base, 1);
// Try to select all messages.
......
......@@ -26,13 +26,18 @@
if (consoleView._isSidebarOpen)
consoleView._splitWidget._showHideSidebarButton.element.click();
function dumpVisibleMessages() {
async function dumpVisibleMessages() {
var menuText = Console.ConsoleView.instance()._filter._levelMenuButton._text;
TestRunner.addResult('Level menu: ' + menuText);
var messages = Console.ConsoleView.instance()._visibleViewMessages;
for (var i = 0; i < messages.length; i++)
TestRunner.addResult('>' + messages[i].toMessageElement().deepTextContent());
for (var i = 0; i < messages.length; i++) {
// Ordering is important here, as accessing the element the first time around
// triggers live location creation and updates which we need to await properly.
const element = messages[i].toMessageElement();
await TestRunner.waitForPendingLiveLocationUpdates();
TestRunner.addResult('>' + element.deepTextContent());
}
}
var testSuite = [
......@@ -46,59 +51,50 @@
function beforeFilter(next) {
TestRunner.addResult('beforeFilter');
dumpVisibleMessages();
next();
dumpVisibleMessages().then(next);
},
function allLevels(next) {
Console.ConsoleViewFilter.levelFilterSetting().set(Console.ConsoleFilter.allLevelsFilterValue());
dumpVisibleMessages();
next();
dumpVisibleMessages().then(next);
},
function defaultLevels(next) {
Console.ConsoleViewFilter.levelFilterSetting().set(Console.ConsoleFilter.defaultLevelsFilterValue());
dumpVisibleMessages();
next();
dumpVisibleMessages().then(next);
},
function verbose(next) {
Console.ConsoleViewFilter.levelFilterSetting().set({ verbose: true });
dumpVisibleMessages();
next();
dumpVisibleMessages().then(next);
},
function info(next) {
Console.ConsoleViewFilter.levelFilterSetting().set({ info: true });
dumpVisibleMessages();
next();
dumpVisibleMessages().then(next);
},
function warningsAndErrors(next) {
Console.ConsoleViewFilter.levelFilterSetting().set({ warning: true, error: true });
dumpVisibleMessages();
next();
dumpVisibleMessages().then(next);
},
function abcMessagePlain(next) {
Console.ConsoleViewFilter.levelFilterSetting().set({ verbose: true });
Console.ConsoleView.instance()._filter._textFilterUI.setValue('abc');
Console.ConsoleView.instance()._filter._onFilterChanged();
dumpVisibleMessages();
next();
dumpVisibleMessages().then(next);
},
function abcMessageRegex(next) {
Console.ConsoleView.instance()._filter._textFilterUI.setValue('/ab[a-z]/');
Console.ConsoleView.instance()._filter._onFilterChanged();
dumpVisibleMessages();
next();
dumpVisibleMessages().then(next);
},
function abcMessageRegexWarning(next) {
Console.ConsoleViewFilter.levelFilterSetting().set({ warning: true });
dumpVisibleMessages();
next();
dumpVisibleMessages().then(next);
}
];
......
......@@ -60,14 +60,19 @@
var messages = Console.ConsoleView.instance()._visibleViewMessages;
function dumpVisibleMessages() {
async function dumpVisibleMessages() {
var messages = Console.ConsoleView.instance()._visibleViewMessages;
for (var i = 0; i < messages.length; ++i) {
var viewMessage = messages[i];
var delimeter = viewMessage.consoleMessage().isGroupStartMessage() ? '>' : '';
var indent = '';
for (var j = 0; j < viewMessage.nestingLevel(); ++j) indent += ' ';
TestRunner.addResult(indent + delimeter + viewMessage.toMessageElement().deepTextContent());
// Ordering is important here, as accessing the element the first time around
// triggers live location creation and updates which we need to await properly.
const element = viewMessage.toMessageElement();
await TestRunner.waitForPendingLiveLocationUpdates();
TestRunner.addResult(indent + delimeter + element.deepTextContent());
}
}
......@@ -77,84 +82,70 @@
TestRunner.runTestSuite([
function beforeFilter(next) {
TestRunner.addResult('beforeFilter');
dumpVisibleMessages();
next();
dumpVisibleMessages().then(next);
},
function allLevelsFilter(next) {
Console.ConsoleViewFilter.levelFilterSetting().set(Console.ConsoleFilter.allLevelsFilterValue());
dumpVisibleMessages();
next();
dumpVisibleMessages().then(next);
},
function addURL1Filter(next) {
TestRunner.addResult('Blocking messages from ' + url1);
Console.ConsoleView.instance()._filter.addMessageURLFilter(url1);
dumpVisibleMessages();
next();
dumpVisibleMessages().then(next);
},
function addURL2Filter(next) {
TestRunner.addResult('Blocking messages from ' + url2);
Console.ConsoleView.instance()._filter.addMessageURLFilter(url2);
dumpVisibleMessages();
next();
dumpVisibleMessages().then(next);
},
function removeAllFilters(next) {
Console.ConsoleView.instance()._filter._textFilterUI.setValue('');
Console.ConsoleView.instance()._filter._onFilterChanged();
dumpVisibleMessages();
next();
dumpVisibleMessages().then(next);
},
function checkTextFilter(next) {
Console.ConsoleView.instance()._filter._textFilterUI.setValue('outer');
Console.ConsoleView.instance()._filter._onFilterChanged();
dumpVisibleMessages();
next();
dumpVisibleMessages().then(next);
},
function checkMultiTextFilter(next) {
Console.ConsoleView.instance()._filter._textFilterUI.setValue("Group /[2-3]top/");
Console.ConsoleView.instance()._filter._onFilterChanged();
dumpVisibleMessages();
next();
dumpVisibleMessages().then(next);
},
function checkTextUrlFilter(next) {
Console.ConsoleView.instance()._filter._textFilterUI.setValue("url:log-source");
Console.ConsoleView.instance()._filter._onFilterChanged();
dumpVisibleMessages();
next();
dumpVisibleMessages().then(next);
},
function checkNegativeTextUrlFilter(next) {
Console.ConsoleView.instance()._filter._textFilterUI.setValue("-url:log-source");
Console.ConsoleView.instance()._filter._onFilterChanged();
dumpVisibleMessages();
next();
dumpVisibleMessages().then(next);
},
function checkSourceFilter(next) {
Console.ConsoleView.instance()._filter._textFilterUI.setValue("source:violation");
Console.ConsoleView.instance()._filter._onFilterChanged();
dumpVisibleMessages();
next();
dumpVisibleMessages().then(next);
},
function checkContextTextFilter(next) {
Console.ConsoleView.instance()._filter._textFilterUI.setValue("context:context");
Console.ConsoleView.instance()._filter._onFilterChanged();
dumpVisibleMessages();
next();
dumpVisibleMessages().then(next);
},
function checkStartEndLineRegex(next) {
Console.ConsoleView.instance()._filter._textFilterUI.setValue("/^Hello\\s\\d$/");
Console.ConsoleView.instance()._filter._onFilterChanged();
dumpVisibleMessages();
next();
dumpVisibleMessages().then(next);
},
function checkStartEndLineRegexForAnchor(next) {
Console.ConsoleView.instance()._filter._textFilterUI.setValue("/^log-source\\.js:\\d+$/");
Console.ConsoleView.instance()._filter._onFilterChanged();
dumpVisibleMessages();
next();
dumpVisibleMessages().then(next);
},
function checkResetFilter(next) {
Console.ConsoleView.instance()._filter.reset();
dumpVisibleMessages();
next();
dumpVisibleMessages().then(next);
}
]);
})();
......@@ -24,37 +24,40 @@
TestRunner.evaluateInPage('boo()', step1);
function step1() {
dumpConsoleMessageURLs();
async function step1() {
await dumpConsoleMessageURLs();
TestRunner.addSniffer(Bindings.BlackboxManager.prototype, '_patternChangeFinishedForTests', step2);
var frameworkRegexString = 'foo\\.js';
Common.settingForTest('skipStackFramesPattern').set(frameworkRegexString);
}
function step2() {
dumpConsoleMessageURLs();
async function step2() {
await dumpConsoleMessageURLs();
TestRunner.addSniffer(Bindings.BlackboxManager.prototype, '_patternChangeFinishedForTests', step3);
var frameworkRegexString = 'foo\\.js|boo\\.js';
Common.settingForTest('skipStackFramesPattern').set(frameworkRegexString);
}
function step3() {
dumpConsoleMessageURLs();
async function step3() {
await dumpConsoleMessageURLs();
TestRunner.addSniffer(Bindings.BlackboxManager.prototype, '_patternChangeFinishedForTests', step4);
var frameworkRegexString = '';
Common.settingForTest('skipStackFramesPattern').set(frameworkRegexString);
}
function step4() {
dumpConsoleMessageURLs();
async function step4() {
await dumpConsoleMessageURLs();
TestRunner.completeTest();
}
function dumpConsoleMessageURLs() {
async function dumpConsoleMessageURLs() {
var messages = Console.ConsoleView.instance()._visibleViewMessages;
for (var i = 0; i < messages.length; ++i) {
// Ordering is important here. Retrieveing the message element the first time triggers
// live location creation and updates, which we need to await for correct locations.
var element = messages[i].toMessageElement();
await TestRunner.waitForPendingLiveLocationUpdates();
var anchor = element.querySelector('.console-message-anchor');
TestRunner.addResult(anchor.textContent.replace(/VM\d+/g, 'VM'));
}
......
......@@ -12,8 +12,12 @@
var messages = Console.ConsoleView.instance()._visibleViewMessages;
TestRunner.runTestSuite([
function testClickRelativeLink(next) {
var clickTarget = messages[0].element().querySelectorAll('.console-message-text .devtools-link')[1];
async function testClickRelativeLink(next) {
// Ordering is important here, as accessing the element the first time around
// triggers live location creation and updates which we need to await properly.
const element = messages[0].element();
await TestRunner.waitForPendingLiveLocationUpdates();
const clickTarget = element.querySelectorAll('.console-message-text .devtools-link')[1];
TestRunner.addResult('Clicking link ' + clickTarget.textContent);
UI.inspectorView._tabbedPane.once(UI.TabbedPane.Events.TabSelected).then(() => {
TestRunner.addResult('Panel ' + UI.inspectorView._tabbedPane._currentTab.id + ' was opened.');
......
......@@ -37,7 +37,11 @@
},
async function testClickLinkToRevealAnotherPanel(next) {
consoleView._visibleViewMessages[0]._element.querySelector('.devtools-link').click();
// Ordering is important here, as accessing the element the first time around
// triggers live location creation and updates which we need to await properly.
const element = consoleView._visibleViewMessages[0]._element;
await TestRunner.waitForPendingLiveLocationUpdates();
element.querySelector('.devtools-link').click();
await UI.inspectorView._tabbedPane.once(UI.TabbedPane.Events.TabSelected);
await TestRunner.showPanel('console');
dumpScrollTop();
......
......@@ -8,7 +8,7 @@ promiseTest1 @ console-uncaught-promise.js:29
timeout @ console-uncaught-promise.js:19
setTimeout (async)
runNextPromiseTest @ console-uncaught-promise.js:18
(anonymous) @ console-uncaught-promise.js:103
(anonymous) @ console-uncaught-promise.js:100
console-uncaught-promise.js:47 Uncaught (in promise) Error: err2
promiseTest2 @ console-uncaught-promise.js:47
timeout @ console-uncaught-promise.js:19
......@@ -23,7 +23,7 @@ promiseTest2 @ console-uncaught-promise.js:40
timeout @ console-uncaught-promise.js:19
setTimeout (async)
runNextPromiseTest @ console-uncaught-promise.js:18
(anonymous) @ console-uncaught-promise.js:106
(anonymous) @ console-uncaught-promise.js:100
console-uncaught-promise.js:65 Uncaught (in promise) DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
throwDOMException @ console-uncaught-promise.js:65
catcher @ console-uncaught-promise.js:57
......@@ -32,25 +32,25 @@ promiseTest3 @ console-uncaught-promise.js:56
timeout @ console-uncaught-promise.js:19
setTimeout (async)
runNextPromiseTest @ console-uncaught-promise.js:18
(anonymous) @ console-uncaught-promise.js:106
(anonymous) @ console-uncaught-promise.js:100
console-uncaught-promise.js:71 Uncaught (in promise) 42
promiseTest4 @ console-uncaught-promise.js:71
timeout @ console-uncaught-promise.js:19
setTimeout (async)
runNextPromiseTest @ console-uncaught-promise.js:18
(anonymous) @ console-uncaught-promise.js:106
(anonymous) @ console-uncaught-promise.js:100
console-uncaught-promise.js:76 Uncaught (in promise) 1e+100
promiseTest5 @ console-uncaught-promise.js:76
timeout @ console-uncaught-promise.js:19
setTimeout (async)
runNextPromiseTest @ console-uncaught-promise.js:18
(anonymous) @ console-uncaught-promise.js:106
(anonymous) @ console-uncaught-promise.js:100
console-uncaught-promise.js:81 Uncaught (in promise) foo
promiseTest6 @ console-uncaught-promise.js:81
timeout @ console-uncaught-promise.js:19
setTimeout (async)
runNextPromiseTest @ console-uncaught-promise.js:18
(anonymous) @ console-uncaught-promise.js:106
(anonymous) @ console-uncaught-promise.js:100
console-uncaught-promise.js:86 Uncaught (in promise) {foo: 42}
foo: 42
__proto__: Object
......@@ -58,13 +58,13 @@ promiseTest7 @ console-uncaught-promise.js:86
timeout @ console-uncaught-promise.js:19
setTimeout (async)
runNextPromiseTest @ console-uncaught-promise.js:18
(anonymous) @ console-uncaught-promise.js:106
(anonymous) @ console-uncaught-promise.js:100
console-uncaught-promise.js:91 Uncaught (in promise) undefined
promiseTest8 @ console-uncaught-promise.js:91
timeout @ console-uncaught-promise.js:19
setTimeout (async)
runNextPromiseTest @ console-uncaught-promise.js:18
(anonymous) @ console-uncaught-promise.js:106
(anonymous) @ console-uncaught-promise.js:100
A bad HTTP response code (404) was received when fetching the script.
inspected-page.html:1 Uncaught (in promise) TypeError: Failed to register a ServiceWorker for scope ('http://127.0.0.1:8000/devtools/console/') with script ('http://127.0.0.1:8000/devtools/console/404'): A bad HTTP response code (404) was received when fetching the script.
......@@ -97,22 +97,12 @@
}
`);
ConsoleTestRunner.addConsoleViewSniffer(checkConsoleMessages, true);
Common.console.showPromise();
checkConsoleMessages();
function checkConsoleMessages() {
TestRunner.evaluateInPage('runNextPromiseTest()', callback);
function callback(result) {
if (!result)
ConsoleTestRunner.expandConsoleMessages(dump);
}
while (await TestRunner.evaluateInPagePromise('runNextPromiseTest()')) {
// Run all the test cases until there are no more.
}
function dump() {
ConsoleTestRunner.dumpConsoleMessagesIgnoreErrorStackFrames();
TestRunner.completeTest();
}
ConsoleTestRunner.expandConsoleMessages(async () => {
await ConsoleTestRunner.dumpConsoleMessagesIgnoreErrorStackFrames();
TestRunner.completeTest();
});
})();
......@@ -25,29 +25,29 @@
var viewportMessagesCount;
var testSuite = [
function testSelectionSingleLineText(next) {
async function testSelectionSingleLineText(next) {
viewport.invalidate();
viewport.forceScrollItemToBeFirst(0);
viewportMessagesCount = viewport.lastVisibleIndex() - viewport.firstVisibleIndex() + 1;
selectMessages(middleMessage, 2, middleMessage, 7);
await selectMessages(middleMessage, 2, middleMessage, 7);
dumpSelectionText();
next();
},
function testReversedSelectionSingleLineText(next) {
selectMessages(middleMessage, 7, middleMessage, 2);
async function testReversedSelectionSingleLineText(next) {
await selectMessages(middleMessage, 7, middleMessage, 2);
dumpSelectionText();
next();
},
function testSelectionMultiLineText(next) {
selectMessages(middleMessage - 1, 4, middleMessage + 1, 7);
async function testSelectionMultiLineText(next) {
await selectMessages(middleMessage - 1, 4, middleMessage + 1, 7);
dumpSelectionText();
next();
},
function testSimpleVisibleSelection(next) {
selectMessages(middleMessage - 3, 6, middleMessage + 2, 6);
async function testSimpleVisibleSelection(next) {
await selectMessages(middleMessage - 3, 6, middleMessage + 2, 6);
dumpSelectionModel();
next();
},
......@@ -77,14 +77,14 @@
next();
},
function testShiftClickSelectionOver(next) {
emulateShiftClickOnMessage(minimumViewportMessagesCount);
async function testShiftClickSelectionOver(next) {
await emulateShiftClickOnMessage(minimumViewportMessagesCount);
dumpSelectionModel();
next();
},
function testShiftClickSelectionBelow(next) {
emulateShiftClickOnMessage(messagesCount - minimumViewportMessagesCount);
async function testShiftClickSelectionBelow(next) {
await emulateShiftClickOnMessage(messagesCount - minimumViewportMessagesCount);
dumpSelectionModel();
next();
},
......@@ -96,20 +96,20 @@
next();
},
function testReversedVisibleSelection(next) {
selectMessages(middleMessage + 1, 6, middleMessage - 4, 6);
async function testReversedVisibleSelection(next) {
await selectMessages(middleMessage + 1, 6, middleMessage - 4, 6);
dumpSelectionModel();
next();
},
function testShiftClickReversedSelectionOver(next) {
emulateShiftClickOnMessage(minimumViewportMessagesCount);
async function testShiftClickReversedSelectionOver(next) {
await emulateShiftClickOnMessage(minimumViewportMessagesCount);
dumpSelectionModel();
next();
},
function testShiftClickReversedSelectionBelow(next) {
emulateShiftClickOnMessage(messagesCount - minimumViewportMessagesCount);
async function testShiftClickReversedSelectionBelow(next) {
await emulateShiftClickOnMessage(messagesCount - minimumViewportMessagesCount);
dumpSelectionModel();
next();
},
......@@ -196,7 +196,7 @@
TestRunner.addResult('Selected text:<<<EOL\n' + text + '\nEOL');
}
function emulateShiftClickOnMessage(messageIndex) {
async function emulateShiftClickOnMessage(messageIndex) {
viewport.refresh();
var selection = window.getSelection();
if (!selection || !selection.rangeCount) {
......@@ -205,11 +205,13 @@
}
viewport.forceScrollItemToBeFirst(Math.max(messageIndex - minimumViewportMessagesCount / 2, 0));
var element = consoleView.itemElement(messageIndex).element();
// Console messages contain live locations.
await TestRunner.waitForPendingLiveLocationUpdates();
selection.setBaseAndExtent(selection.anchorNode, selection.anchorOffset, element, 0);
viewport.refresh();
}
function selectMessages(fromMessage, fromTextOffset, toMessage, toTextOffset) {
async function selectMessages(fromMessage, fromTextOffset, toMessage, toTextOffset) {
if (Math.abs(toMessage - fromMessage) > minimumViewportMessagesCount) {
TestRunner.addResult(String.sprintf(
'FAILURE: Cannot select more than %d messages (requested to select from %d to %d',
......@@ -219,7 +221,7 @@
}
viewport.forceScrollItemToBeFirst(Math.min(fromMessage, toMessage));
ConsoleTestRunner.selectConsoleMessages(fromMessage, fromTextOffset, toMessage, toTextOffset);
await ConsoleTestRunner.selectConsoleMessages(fromMessage, fromTextOffset, toMessage, toTextOffset);
viewport.refresh();
}
})();
......@@ -24,125 +24,125 @@
await ConsoleTestRunner.waitForPendingViewportUpdates();
TestRunner.runTestSuite([
function testBetweenViewportAndExternal(next) {
async function testBetweenViewportAndExternal(next) {
TestRunner.addResult(`Setting focus in prompt:`);
prompt.focus();
dumpFocus();
await dumpFocus();
shiftPress('Tab');
dumpFocus();
await dumpFocus();
press('ArrowUp');
dumpFocus();
await dumpFocus();
shiftPress('Tab');
dumpFocus();
await dumpFocus();
press('Tab');
dumpFocus();
await dumpFocus();
press('ArrowUp');
dumpFocus();
await dumpFocus();
press('Tab');
dumpFocus();
await dumpFocus();
next();
},
function testBetweenViewportAndExternalWithSelectedItemNotInDOM(next) {
async function testBetweenViewportAndExternalWithSelectedItemNotInDOM(next) {
TestRunner.addResult(`Setting focus in prompt:`);
prompt.focus();
dumpFocus();
await dumpFocus();
shiftPress('Tab');
dumpFocus();
await dumpFocus();
press('ArrowUp');
dumpFocus();
await dumpFocus();
scrollViewportToTop();
dumpFocus();
await dumpFocus();
shiftPress('Tab');
dumpFocus();
await dumpFocus();
press('Tab');
dumpFocus();
await dumpFocus();
press('ArrowUp');
dumpFocus();
await dumpFocus();
TestRunner.addResult(`\nSetting focus in prompt:`);
prompt.focus();
dumpFocus();
await dumpFocus();
shiftPress('Tab');
dumpFocus();
await dumpFocus();
press('ArrowUp');
dumpFocus();
await dumpFocus();
scrollViewportToTop();
dumpFocus();
await dumpFocus();
press('Tab');
dumpFocus();
await dumpFocus();
next();
},
function testMoveAcrossLogsWithinViewport(next) {
async function testMoveAcrossLogsWithinViewport(next) {
forceSelect(logCount - 1);
dumpFocus();
await dumpFocus();
press('Home');
dumpFocus();
await dumpFocus();
press('ArrowDown');
dumpFocus();
await dumpFocus();
press('ArrowDown');
dumpFocus();
await dumpFocus();
press('End');
dumpFocus();
await dumpFocus();
press('ArrowUp');
dumpFocus();
await dumpFocus();
press('ArrowUp');
dumpFocus();
await dumpFocus();
next();
},
function testViewportDoesNotChangeFocusOnScroll(next) {
async function testViewportDoesNotChangeFocusOnScroll(next) {
forceSelect(logCount - 2);
dumpFocus();
await dumpFocus();
scrollViewportToTop();
dumpFocus();
await dumpFocus();
scrollViewportToBottom();
dumpFocus();
await dumpFocus();
next();
},
function testViewportDoesNotStealFocusOnScroll(next) {
async function testViewportDoesNotStealFocusOnScroll(next) {
forceSelect(logCount - 1);
dumpFocus();
await dumpFocus();
TestRunner.addResult(`Setting focus in prompt:`);
prompt.focus();
dumpFocus();
await dumpFocus();
scrollViewportToTop();
dumpFocus();
await dumpFocus();
scrollViewportToBottom();
dumpFocus();
await dumpFocus();
next();
},
......@@ -150,20 +150,20 @@
async function testNewLogsShouldNotMoveFocus(next) {
TestRunner.addResult(`Setting focus in prompt:`);
prompt.focus();
dumpFocus();
await dumpFocus();
await TestRunner.evaluateInPagePromise(`console.log("New Message")`);
await ConsoleTestRunner.waitForConsoleMessagesPromise(logCount + 1);
await ConsoleTestRunner.waitForPendingViewportUpdates();
dumpFocus();
await dumpFocus();
next();
},
function testClearingConsoleFocusesPrompt(next) {
async function testClearingConsoleFocusesPrompt(next) {
TestRunner.addResult(`\nConsole cleared:`);
consoleView._consoleCleared();
dumpFocus();
await dumpFocus();
next();
}
]);
......@@ -200,8 +200,10 @@
eventSender.keyDown(key, ['shiftKey']);
}
function dumpFocus() {
async function dumpFocus() {
var element = document.deepActiveElement();
// Console elements contain live locations that might not be fully resolved yet.
await TestRunner.waitForPendingLiveLocationUpdates();
if (!element) {
TestRunner.addResult('null');
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment