From ed6e264f0af36c0e340f8a72f9bc5b38c0fe5fec Mon Sep 17 00:00:00 2001 From: Tim van der Lippe Date: Thu, 11 Mar 2021 14:36:37 +0000 Subject: [PATCH] Load legacy modules in DevTools layout tests 1/n R=aerotwist@chromium.org Bug: 1131500 Change-Id: I57e9b3a8694916092236bf4863c8569d1e6e6974 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2749216 Commit-Queue: Tim van der Lippe Auto-Submit: Tim van der Lippe Reviewed-by: Paul Lewis Cr-Commit-Position: refs/heads/master@{#861970} --- .../devtools/changes/changes-highlighter.js | 1 + .../tests/devtools/changes/changes-sidebar.js | 1 + .../tests/devtools/components/cookies-table.js | 4 +++- .../http/tests/devtools/components/linkifier.js | 1 + .../console/console-log-linkify-links.js | 1 + .../devtools/elements/elements-img-tooltip.js | 1 + .../devtools/extensions/extensions-resources.js | 1 + .../tests/devtools/help/release-note-unit.js | 1 + .../http/tests/devtools/help/release-note.js | 1 + .../jump-to-previous-editing-location.js | 1 + .../debugger-ui/last-execution-context.js | 1 + ...allstack-network-initiator-image-expected.txt | 2 +- .../async-callstack-network-initiator-image.js | 1 + .../devtools/throttling/mobile-throttling.js | 1 + .../timeline-js/timeline-script-id-expected.txt | 16 ++++++++-------- .../tracing/timeline-js/timeline-script-id.js | 1 + .../timeline-misc/timeline-event-causes.js | 1 + .../timeline-misc/timeline-node-reference.js | 1 + ...imeline-network-resource-details-expected.txt | 2 +- .../timeline-network-resource-details.js | 1 + 20 files changed, 29 insertions(+), 11 deletions(-) diff --git a/third_party/blink/web_tests/http/tests/devtools/changes/changes-highlighter.js b/third_party/blink/web_tests/http/tests/devtools/changes/changes-highlighter.js index 265f41254d92bf..bfb95c8d6ac080 100644 --- a/third_party/blink/web_tests/http/tests/devtools/changes/changes-highlighter.js +++ b/third_party/blink/web_tests/http/tests/devtools/changes/changes-highlighter.js @@ -6,6 +6,7 @@ TestRunner.addResult(`Tests that the changes view highlights diffs correctly.\n`); await TestRunner.loadModule('sources_test_runner'); await TestRunner.loadModule('changes'); + await TestRunner.loadLegacyModule('changes'); await TestRunner.showPanel('sources'); await TestRunner.addStylesheetTag('resources/before.css'); await TestRunner.addStylesheetTag('resources/after.css'); diff --git a/third_party/blink/web_tests/http/tests/devtools/changes/changes-sidebar.js b/third_party/blink/web_tests/http/tests/devtools/changes/changes-sidebar.js index 32a87fc54444a1..305d1b06117656 100644 --- a/third_party/blink/web_tests/http/tests/devtools/changes/changes-sidebar.js +++ b/third_party/blink/web_tests/http/tests/devtools/changes/changes-sidebar.js @@ -5,6 +5,7 @@ (async function() { TestRunner.addResult(`Tests that the changes sidebar contains the changed uisourcecodes.\n`); await TestRunner.loadModule('changes'); + await TestRunner.loadLegacyModule('changes'); var fulfill = function() {}; var workspace = new Workspace.Workspace(); diff --git a/third_party/blink/web_tests/http/tests/devtools/components/cookies-table.js b/third_party/blink/web_tests/http/tests/devtools/components/cookies-table.js index 2ec159f0f5d92f..3fdb73a2f98f14 100644 --- a/third_party/blink/web_tests/http/tests/devtools/components/cookies-table.js +++ b/third_party/blink/web_tests/http/tests/devtools/components/cookies-table.js @@ -154,5 +154,7 @@ TestRunner.completeTest(); } - self.runtime.loadModulePromise('cookie_table').then(run); + await self.runtime.loadModulePromise('cookie_table'); + await TestRunner.loadLegacyModule('cookie_table'); + run(); })(); diff --git a/third_party/blink/web_tests/http/tests/devtools/components/linkifier.js b/third_party/blink/web_tests/http/tests/devtools/components/linkifier.js index c6cae6fc731f72..64a3e05f2ad306 100644 --- a/third_party/blink/web_tests/http/tests/devtools/components/linkifier.js +++ b/third_party/blink/web_tests/http/tests/devtools/components/linkifier.js @@ -5,6 +5,7 @@ (async function() { TestRunner.addResult(`Tests that Linkifier works correctly.\n`); await TestRunner.loadModule('sources_test_runner'); + await TestRunner.loadLegacyModule('components'); await TestRunner.showPanel('sources'); await TestRunner.evaluateInPagePromise(`function foo () {} //# sourceURL=linkifier.js`) var script; diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-log-linkify-links.js b/third_party/blink/web_tests/http/tests/devtools/console/console-log-linkify-links.js index fcfa938e64f809..9c5fc891113c41 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-log-linkify-links.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-log-linkify-links.js @@ -6,6 +6,7 @@ TestRunner.addResult(`Test that console.log() would linkify the links. Bug 231074.\n`); await TestRunner.loadModule('console_test_runner'); + await TestRunner.loadLegacyModule('components'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` console.log("www.chromium.org"); diff --git a/third_party/blink/web_tests/http/tests/devtools/elements/elements-img-tooltip.js b/third_party/blink/web_tests/http/tests/devtools/elements/elements-img-tooltip.js index 328600e3aaf666..f3bb14b7fbc4bc 100644 --- a/third_party/blink/web_tests/http/tests/devtools/elements/elements-img-tooltip.js +++ b/third_party/blink/web_tests/http/tests/devtools/elements/elements-img-tooltip.js @@ -5,6 +5,7 @@ (async function() { TestRunner.addResult(`Tests the tooltip for the image on hover.\n`); await TestRunner.loadModule('elements_test_runner'); + await TestRunner.loadLegacyModule('components'); await TestRunner.showPanel('elements'); const imgURL = `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANcAAACuCAIAAAAqMg/rAAAAAXNSR0IArs4c6QAAAU9JREFUeNrt0jERAAAIxDDAv+dHAxNLIqHXTlLwaiTAheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSFEuBCcCEuBBfiQnAhLgQX4kJwIS4EF+JCcCEuBBfiQnAhLgQX4kJwIS4EF+JCcCEuBBfiQnAhLgQX4kJwIS4EF+JCcCEuBBfiQnAhLoSDBZXqBFnkRyeqAAAAAElFTkSuQmCC`; await TestRunner.loadHTML(` diff --git a/third_party/blink/web_tests/http/tests/devtools/extensions/extensions-resources.js b/third_party/blink/web_tests/http/tests/devtools/extensions/extensions-resources.js index 08bc2e9effce65..5543069fe38487 100644 --- a/third_party/blink/web_tests/http/tests/devtools/extensions/extensions-resources.js +++ b/third_party/blink/web_tests/http/tests/devtools/extensions/extensions-resources.js @@ -7,6 +7,7 @@ await TestRunner.loadModule('console_test_runner'); await TestRunner.loadModule('extensions_test_runner'); await TestRunner.loadModule('sources_test_runner'); + await TestRunner.loadLegacyModule('components'); TestRunner.clickOnURL = async function() { await UI.viewManager.showView("console").then(() => { diff --git a/third_party/blink/web_tests/http/tests/devtools/help/release-note-unit.js b/third_party/blink/web_tests/http/tests/devtools/help/release-note-unit.js index 18ec558d94e3df..f34fc02fb66bfe 100644 --- a/third_party/blink/web_tests/http/tests/devtools/help/release-note-unit.js +++ b/third_party/blink/web_tests/http/tests/devtools/help/release-note-unit.js @@ -4,6 +4,7 @@ (async function() { await TestRunner.loadModule('help'); + await TestRunner.loadLegacyModule('help'); TestRunner.addResult(`Unit test for release note\n`); diff --git a/third_party/blink/web_tests/http/tests/devtools/help/release-note.js b/third_party/blink/web_tests/http/tests/devtools/help/release-note.js index bb5e7c0976c333..d50842821296cd 100644 --- a/third_party/blink/web_tests/http/tests/devtools/help/release-note.js +++ b/third_party/blink/web_tests/http/tests/devtools/help/release-note.js @@ -4,6 +4,7 @@ (async function() { await TestRunner.loadModule('help'); + await TestRunner.loadLegacyModule('help'); TestRunner.addResult(`Test release note\n`); diff --git a/third_party/blink/web_tests/http/tests/devtools/jump-to-previous-editing-location.js b/third_party/blink/web_tests/http/tests/devtools/jump-to-previous-editing-location.js index 951796da5dd947..27f14fe6f820c0 100644 --- a/third_party/blink/web_tests/http/tests/devtools/jump-to-previous-editing-location.js +++ b/third_party/blink/web_tests/http/tests/devtools/jump-to-previous-editing-location.js @@ -6,6 +6,7 @@ TestRunner.addResult(`Tests that jumping to previous location works as intended.\n`); await TestRunner.loadModule('console_test_runner'); await TestRunner.loadModule('sources_test_runner'); + await TestRunner.loadLegacyModule('components'); await TestRunner.showPanel('sources'); await TestRunner.addScriptTag('resources/example-fileset-for-test.js'); await TestRunner.addScriptTag('resources/jump-text.js'); diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/last-execution-context.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/last-execution-context.js index 18993e11d164bd..29a75d3b49a737 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/last-execution-context.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/last-execution-context.js @@ -5,6 +5,7 @@ (async function() { TestRunner.addResult(`Tests how execution context and target are selected.\n`); await TestRunner.loadModule('sdk_test_runner'); + await TestRunner.loadLegacyModule('main'); await TestRunner.showPanel('sources'); var context = new UI.Context(); diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/async-callstack-network-initiator-image-expected.txt b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/async-callstack-network-initiator-image-expected.txt index d59d6a32388c5f..71fb33e0b42ed6 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/async-callstack-network-initiator-image-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/async-callstack-network-initiator-image-expected.txt @@ -1,4 +1,4 @@ Tests asynchronous network initiator for image loaded from JS. -async-callstack-network-initiator-image.js:14 +async-callstack-network-initiator-image.js:15 diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/async-callstack-network-initiator-image.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/async-callstack-network-initiator-image.js index 720cde9e31fe5a..7668bd222262c1 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/async-callstack-network-initiator-image.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/async-callstack-network-initiator-image.js @@ -6,6 +6,7 @@ TestRunner.addResult(`Tests asynchronous network initiator for image loaded from JS.\n`); await TestRunner.loadModule('sources_test_runner'); await TestRunner.loadModule('console_test_runner'); + await TestRunner.loadLegacyModule('components'); await TestRunner.showPanel('sources'); await TestRunner.evaluateInPagePromise(` function testFunction() diff --git a/third_party/blink/web_tests/http/tests/devtools/throttling/mobile-throttling.js b/third_party/blink/web_tests/http/tests/devtools/throttling/mobile-throttling.js index e2d9514223caf2..171f5b367cf7b7 100644 --- a/third_party/blink/web_tests/http/tests/devtools/throttling/mobile-throttling.js +++ b/third_party/blink/web_tests/http/tests/devtools/throttling/mobile-throttling.js @@ -6,6 +6,7 @@ TestRunner.addResult(`Tests that mobile, network, and CPU throttling interact with each other logically.\n`); await TestRunner.showPanel("network"); await TestRunner.showPanel("timeline"); + await TestRunner.loadLegacyModule('emulation'); await UI.viewManager.showView("network.config"); var deviceModeView = new Emulation.DeviceModeView(); diff --git a/third_party/blink/web_tests/http/tests/devtools/tracing/timeline-js/timeline-script-id-expected.txt b/third_party/blink/web_tests/http/tests/devtools/tracing/timeline-js/timeline-script-id-expected.txt index 08a0a3a6b16a8d..ec66924629251b 100644 --- a/third_party/blink/web_tests/http/tests/devtools/tracing/timeline-js/timeline-script-id-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/tracing/timeline-js/timeline-script-id-expected.txt @@ -1,14 +1,14 @@ Test that checks location resolving mechanics for TimerInstall TimerRemove and FunctionCall events with scriptId. It expects two FunctionCall for InjectedScript, two TimerInstall events, two FunctionCall events and one TimerRemove event to be logged with performActions.js script name and some line number. -detailsTextContent for TimerInstall event: 'performActions.js:32' -details.textContent for TimerInstall event: 'performActions.js:32' detailsTextContent for TimerInstall event: 'performActions.js:33' details.textContent for TimerInstall event: 'performActions.js:33' -detailsTextContent for FunctionCall event: 'performActions.js:37' -details.textContent for FunctionCall event: 'intervalTimerWork @ performActions.js:37' -detailsTextContent for FunctionCall event: 'performActions.js:37' -details.textContent for FunctionCall event: 'intervalTimerWork @ performActions.js:37' -detailsTextContent for TimerRemove event: 'performActions.js:40' -details.textContent for TimerRemove event: 'performActions.js:40' +detailsTextContent for TimerInstall event: 'performActions.js:34' +details.textContent for TimerInstall event: 'performActions.js:34' +detailsTextContent for FunctionCall event: 'performActions.js:38' +details.textContent for FunctionCall event: 'intervalTimerWork @ performActions.js:38' +detailsTextContent for FunctionCall event: 'performActions.js:38' +details.textContent for FunctionCall event: 'intervalTimerWork @ performActions.js:38' +detailsTextContent for TimerRemove event: 'performActions.js:41' +details.textContent for TimerRemove event: 'performActions.js:41' diff --git a/third_party/blink/web_tests/http/tests/devtools/tracing/timeline-js/timeline-script-id.js b/third_party/blink/web_tests/http/tests/devtools/tracing/timeline-js/timeline-script-id.js index 23074d2c9d85d8..02e002d900a0da 100644 --- a/third_party/blink/web_tests/http/tests/devtools/tracing/timeline-js/timeline-script-id.js +++ b/third_party/blink/web_tests/http/tests/devtools/tracing/timeline-js/timeline-script-id.js @@ -7,6 +7,7 @@ `Test that checks location resolving mechanics for TimerInstall TimerRemove and FunctionCall events with scriptId. It expects two FunctionCall for InjectedScript, two TimerInstall events, two FunctionCall events and one TimerRemove event to be logged with performActions.js script name and some line number.\n`); await TestRunner.loadModule('performance_test_runner'); + await TestRunner.loadLegacyModule('components'); await TestRunner.showPanel('timeline'); function performActions() { diff --git a/third_party/blink/web_tests/http/tests/devtools/tracing/timeline-misc/timeline-event-causes.js b/third_party/blink/web_tests/http/tests/devtools/tracing/timeline-misc/timeline-event-causes.js index 84c1fa40083645..068922a2e16f16 100644 --- a/third_party/blink/web_tests/http/tests/devtools/tracing/timeline-misc/timeline-event-causes.js +++ b/third_party/blink/web_tests/http/tests/devtools/tracing/timeline-misc/timeline-event-causes.js @@ -5,6 +5,7 @@ (async function() { TestRunner.addResult(`Test that causes are correctly generated for various types of events.\n`); await TestRunner.loadModule('performance_test_runner'); + await TestRunner.loadLegacyModule('components'); await TestRunner.showPanel('timeline'); await TestRunner.loadHTML(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/tracing/timeline-misc/timeline-node-reference.js b/third_party/blink/web_tests/http/tests/devtools/tracing/timeline-misc/timeline-node-reference.js index 714a6dd7dab4b7..d0c3a4cc060b3e 100644 --- a/third_party/blink/web_tests/http/tests/devtools/tracing/timeline-misc/timeline-node-reference.js +++ b/third_party/blink/web_tests/http/tests/devtools/tracing/timeline-misc/timeline-node-reference.js @@ -6,6 +6,7 @@ TestRunner.addResult(`Tests the Timeline API instrumentation of a Layout event\n`); await TestRunner.loadModule('elements_test_runner'); await TestRunner.loadModule('performance_test_runner'); + await TestRunner.loadLegacyModule('components'); await TestRunner.showPanel('timeline'); await TestRunner.loadHTML(`