From 40f9a2dd0bf4a56284d116324437164a402dd57a Mon Sep 17 00:00:00 2001 From: Tooru Fujisawa Date: Tue, 24 May 2022 10:05:59 +0000 Subject: [PATCH] Bug 1764717 - Part 6: Use type-specific findMessage(s) in devtools/client/webconsole/test/browser/browser_webconsole_*. r=nchevobbe Differential Revision: https://phabricator.services.mozilla.com/D147026 --- ...nsole_allow_mixedcontent_securityerrors.js | 2 +- .../browser/browser_webconsole_async_stack.js | 8 ++--- .../browser/browser_webconsole_batching.js | 4 ++- ...rowser_webconsole_bidi_string_isolation.js | 2 +- ...nsole_block_mixedcontent_securityerrors.js | 4 +-- .../browser_webconsole_cached_messages.js | 4 +-- ...webconsole_cached_messages_no_duplicate.js | 4 ++- .../browser/browser_webconsole_clear_cache.js | 10 +++---- .../browser_webconsole_clickable_urls.js | 2 +- ...ebconsole_close_groups_after_navigation.js | 2 +- .../browser_webconsole_console_api_iframe.js | 2 +- .../browser_webconsole_console_group.js | 16 +++++----- ...webconsole_console_group_open_no_scroll.js | 6 ++-- ..._webconsole_console_logging_workers_api.js | 16 +++++----- ..._webconsole_console_profile_unavailable.js | 2 +- ...owser_webconsole_console_table_fallback.js | 2 +- ...owser_webconsole_console_trace_distinct.js | 4 +-- ...ser_webconsole_console_trace_duplicates.js | 2 +- ...onsole_context_menu_copy_entire_message.js | 12 ++++---- ...ser_webconsole_context_menu_copy_object.js | 2 +- ...sole_context_menu_export_console_output.js | 4 ++- ...bconsole_context_menu_object_in_sidebar.js | 6 ++-- ...rowser_webconsole_context_menu_open_url.js | 8 +++-- ...onsole_context_menu_reveal_in_inspector.js | 4 +-- ...webconsole_context_menu_store_as_global.js | 2 +- ...onsole_csp_ignore_reflected_xss_message.js | 2 +- .../browser_webconsole_csp_violation.js | 8 ++--- ..._webconsole_css_error_impacted_elements.js | 4 +-- .../browser_webconsole_duplicate_errors.js | 2 +- ...ser_webconsole_error_with_grouped_stack.js | 2 +- ..._webconsole_error_with_longstring_stack.js | 2 +- .../browser_webconsole_error_with_unicode.js | 2 +- .../browser_webconsole_error_with_url.js | 2 +- .../browser/browser_webconsole_eval_error.js | 4 +-- .../browser_webconsole_eval_sources.js | 4 +-- .../browser_webconsole_filter_by_input.js | 4 +-- ...rowser_webconsole_filter_by_regex_input.js | 4 +-- .../browser_webconsole_filter_groups.js | 6 ++-- ...ser_webconsole_filter_navigation_marker.js | 14 ++++----- .../browser_webconsole_filter_scroll.js | 14 +++++---- .../browser/browser_webconsole_filters.js | 4 +-- .../browser_webconsole_filters_persist.js | 8 +++-- .../browser_webconsole_iframe_wrong_hud.js | 4 +-- ...sole_ineffective_iframe_sandbox_warning.js | 6 +--- .../browser/browser_webconsole_input_focus.js | 4 ++- ...sswords_about_blank_web_console_warning.js | 6 +--- ..._insecure_passwords_web_console_warning.js | 4 +-- ..._webconsole_inspect_cross_domain_object.js | 2 +- ...owser_webconsole_keyboard_accessibility.js | 2 +- ...er_webconsole_location_styleeditor_link.js | 2 +- .../browser_webconsole_logErrorInPage.js | 2 +- .../browser_webconsole_logWarningInPage.js | 2 +- .../browser/browser_webconsole_longstring.js | 6 ++-- .../browser_webconsole_longstring_getter.js | 10 +++++-- .../browser_webconsole_mime_css_blocked.js | 2 +- .../browser_webconsole_network_attach.js | 4 ++- ...r_webconsole_network_message_ctrl_click.js | 4 ++- ...console_network_messages_resend_request.js | 8 +++-- ...webconsole_network_messages_status_code.js | 4 ++- .../browser_webconsole_nodes_highlight.js | 2 +- .../browser_webconsole_nodes_select.js | 2 +- ..._webconsole_non_javascript_mime_warning.js | 6 +--- ...onsole_non_javascript_mime_worker_error.js | 12 ++------ ..._webconsole_non_standard_doctype_errors.js | 17 +++++------ .../browser_webconsole_object_ctrl_click.js | 2 +- ...bconsole_object_in_sidebar_keyboard_nav.js | 2 +- .../browser_webconsole_object_inspector.js | 2 +- ...er_webconsole_object_inspector__proto__.js | 2 +- ...ser_webconsole_object_inspector_entries.js | 4 ++- ...ser_webconsole_object_inspector_getters.js | 2 +- ...sole_object_inspector_getters_prototype.js | 2 +- ...nsole_object_inspector_getters_shadowed.js | 2 +- ..._object_inspector_local_session_storage.js | 6 ++-- ...console_object_inspector_nested_promise.js | 4 +-- ...ebconsole_object_inspector_nested_proxy.js | 2 +- ...ole_object_inspector_private_properties.js | 4 ++- ...wser_webconsole_object_inspector_scroll.js | 2 +- ...ser_webconsole_object_inspector_symbols.js | 4 ++- .../browser_webconsole_output_order.js | 4 +-- ...wser_webconsole_promise_rejected_object.js | 7 ++--- .../browser_webconsole_reopen_closed_tab.js | 2 +- ..._webconsole_requestStorageAccess_errors.js | 2 +- ...owser_webconsole_responsive_design_mode.js | 4 +-- ...console_sandbox_update_after_navigation.js | 15 ++++++++-- ...browser_webconsole_script_errordoc_urls.js | 6 +++- .../test/browser/browser_webconsole_scroll.js | 10 ++++--- ...onsole_show_subresource_security_errors.js | 2 +- ...ser_webconsole_shows_reqs_in_netmonitor.js | 2 +- ...debar_object_expand_when_message_pruned.js | 4 +-- .../browser_webconsole_sourcemap_css.js | 2 +- .../browser_webconsole_sourcemap_error.js | 6 ++-- .../browser_webconsole_sourcemap_invalid.js | 2 +- .../browser_webconsole_sourcemap_nosource.js | 4 +-- ...nsole_stacktrace_location_debugger_link.js | 2 +- .../browser_webconsole_strict_mode_errors.js | 2 +- .../browser_webconsole_telemetry_js_errors.js | 4 +-- ...webconsole_telemetry_jump_to_definition.js | 4 ++- ...er_webconsole_telemetry_object_expanded.js | 4 ++- .../browser_webconsole_time_methods.js | 12 ++++---- ...er_webconsole_trackingprotection_errors.js | 14 ++++----- .../browser_webconsole_uncaught_exception.js | 2 +- .../browser/browser_webconsole_view_source.js | 2 +- .../browser_webconsole_visibility_messages.js | 8 ++--- ...wser_webconsole_warn_about_replaced_api.js | 15 +++++----- ...bconsole_warning_group_content_blocking.js | 6 ++-- ...rowser_webconsole_warning_group_cookies.js | 4 +-- ...wser_webconsole_warning_group_multiples.js | 8 +++-- ...console_warning_group_storage_isolation.js | 2 +- .../browser_webconsole_warning_groups.js | 10 ++++--- ...ser_webconsole_warning_groups_filtering.js | 30 ++++++++++--------- ...le_warning_groups_outside_console_group.js | 16 +++++----- ...rowser_webconsole_warning_groups_toggle.js | 18 ++++++----- ...bconsole_webextension_promise_rejection.js | 4 +-- .../browser/browser_webconsole_websocket.js | 4 +-- ...browser_webconsole_worker_promise_error.js | 4 +-- .../browser_webconsole_worklet_error.js | 2 +- 116 files changed, 336 insertions(+), 280 deletions(-) diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_allow_mixedcontent_securityerrors.js b/devtools/client/webconsole/test/browser/browser_webconsole_allow_mixedcontent_securityerrors.js index ae7eb1d76704..68851372b70f 100644 --- a/devtools/client/webconsole/test/browser/browser_webconsole_allow_mixedcontent_securityerrors.js +++ b/devtools/client/webconsole/test/browser/browser_webconsole_allow_mixedcontent_securityerrors.js @@ -36,7 +36,7 @@ add_task(async function() { "\u201chttp://example.com/tests/image/test/mochitest/blue.png\u201d on a secure page"; const waitUntilWarningMessage = text => - waitFor(() => findMessage(hud, text, ".message.warn"), undefined, 100); + waitFor(() => findWarningMessage(hud, text), undefined, 100); const onMixedActiveContent = waitUntilWarningMessage(activeContentText); const onMixedDisplayContent = waitUntilWarningMessage(displayContentText); diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_async_stack.js b/devtools/client/webconsole/test/browser/browser_webconsole_async_stack.js index 9f516b6ef86d..24e648e720dd 100644 --- a/devtools/client/webconsole/test/browser/browser_webconsole_async_stack.js +++ b/devtools/client/webconsole/test/browser/browser_webconsole_async_stack.js @@ -43,14 +43,14 @@ add_task(async function() { ].join("\n"); const traceMsgNode = await waitFor( - () => findMessage(hud, "Trace message", ".console-api.trace"), + () => findConsoleAPIMessage(hud, "Trace message", ".trace"), "Wait for the trace message to be logged" ); let frames = await getSimplifiedStack(traceMsgNode); is(frames, expectedFrames, "console.trace has expected frames"); const consoleErrorMsgNode = await waitFor( - () => findMessage(hud, "console error message", ".console-api.error"), + () => findConsoleAPIMessage(hud, "console error message", ".error"), "Wait for the console error message to be logged" ); consoleErrorMsgNode.querySelector(".arrow").click(); @@ -59,10 +59,10 @@ add_task(async function() { const errorMsgNode = await waitFor( () => - findMessage( + findErrorMessage( hud, "Uncaught Error: Thrown error message", - ".javascript.error" + ".javascript" ), "Wait for the thrown error message to be logged" ); diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_batching.js b/devtools/client/webconsole/test/browser/browser_webconsole_batching.js index 65ef1026fb73..0eabb7c7ae7d 100644 --- a/devtools/client/webconsole/test/browser/browser_webconsole_batching.js +++ b/devtools/client/webconsole/test/browser/browser_webconsole_batching.js @@ -46,7 +46,9 @@ async function testBatchLoggingAndClear(hud, messageNumber) { ) { content.wrappedJSObject.batchLogAndClear(numMessages); }); - await waitFor(() => findMessage(hud, l10n.getStr("consoleCleared"))); + await waitFor(() => + findConsoleAPIMessage(hud, l10n.getStr("consoleCleared")) + ); ok(true, "console cleared message is displayed"); // Passing the text argument as an empty string will returns all the message, diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_bidi_string_isolation.js b/devtools/client/webconsole/test/browser/browser_webconsole_bidi_string_isolation.js index 8b2b1dfd4432..ecb1f99d3aaf 100644 --- a/devtools/client/webconsole/test/browser/browser_webconsole_bidi_string_isolation.js +++ b/devtools/client/webconsole/test/browser/browser_webconsole_bidi_string_isolation.js @@ -48,7 +48,7 @@ add_task(async function() { ]; for (let i = 0; i < texts.length; ++i) { const msgId = "msg" + String(i + 1).padStart(2, "0"); - const message = await waitFor(() => findMessage(hud, msgId)); + const message = await waitFor(() => findConsoleAPIMessage(hud, msgId)); const objectBox = message.querySelector(".objectBox"); is(objectBox.textContent, texts[i], "Should have all the relevant text"); checkRects(objectBox); diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_block_mixedcontent_securityerrors.js b/devtools/client/webconsole/test/browser/browser_webconsole_block_mixedcontent_securityerrors.js index dd23b7ef4176..9ce3ac2cbb65 100644 --- a/devtools/client/webconsole/test/browser/browser_webconsole_block_mixedcontent_securityerrors.js +++ b/devtools/client/webconsole/test/browser/browser_webconsole_block_mixedcontent_securityerrors.js @@ -40,7 +40,7 @@ add_task(async function() { const hud = await openNewTabAndConsole(TEST_URI); const waitForErrorMessage = text => - waitFor(() => findMessage(hud, text, ".message.error"), undefined, 100); + waitFor(() => findErrorMessage(hud, text), undefined, 100); const onBlockedIframe = waitForErrorMessage(blockedActiveContentText); const onBlockedImage = waitForErrorMessage(blockedDisplayContentText); @@ -73,7 +73,7 @@ add_task(async function() { gIdentityHandler.disableMixedContentProtection(); const waitForWarningMessage = text => - waitFor(() => findMessage(hud, text, ".message.warn"), undefined, 100); + waitFor(() => findWarningMessage(hud, text), undefined, 100); const onMixedActiveContent = waitForWarningMessage(activeContentText); const onMixedDisplayContent = waitForWarningMessage(displayContentText); diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_cached_messages.js b/devtools/client/webconsole/test/browser/browser_webconsole_cached_messages.js index 3e3ca3759a39..7d5faaf537da 100644 --- a/devtools/client/webconsole/test/browser/browser_webconsole_cached_messages.js +++ b/devtools/client/webconsole/test/browser/browser_webconsole_cached_messages.js @@ -108,7 +108,7 @@ async function logMessages() { async function testMessagesVisibility(hud, checkNetworkMessage = true) { // wait for the last logged message to be displayed - await waitFor(() => findMessage(hud, "info Bazzle", ".message.info")); + await waitFor(() => findConsoleAPIMessage(hud, "info Bazzle", ".info")); const messages = Array.from(hud.ui.outputNode.querySelectorAll(".message")); const EXPECTED_MESSAGES = [ @@ -178,7 +178,7 @@ async function testMessagesVisibility(hud, checkNetworkMessage = true) { // We can't assert the CSS warning position, so we only check that it's visible. await waitFor( - () => findMessage(hud, "cssColorBug611032", ".message.warn.css"), + () => findWarningMessage(hud, "cssColorBug611032", ".css"), "Couldn't find the CSS warning message" ); ok(true, "css warning message is visible"); diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_cached_messages_no_duplicate.js b/devtools/client/webconsole/test/browser/browser_webconsole_cached_messages_no_duplicate.js index 81b73861b582..2f1e20e6f4e1 100644 --- a/devtools/client/webconsole/test/browser/browser_webconsole_cached_messages_no_duplicate.js +++ b/devtools/client/webconsole/test/browser/browser_webconsole_cached_messages_no_duplicate.js @@ -26,7 +26,9 @@ add_task(async function() { info("wait until all the messages are displayed"); await waitFor( - () => findMessage(hud, "message 1") && findMessage(hud, "message 50") + () => + findConsoleAPIMessage(hud, "message 1") && + findConsoleAPIMessage(hud, "message 50") ); is( diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_clear_cache.js b/devtools/client/webconsole/test/browser/browser_webconsole_clear_cache.js index f99a60cd2057..581c196eba6a 100644 --- a/devtools/client/webconsole/test/browser/browser_webconsole_clear_cache.js +++ b/devtools/client/webconsole/test/browser/browser_webconsole_clear_cache.js @@ -21,8 +21,8 @@ add_task(async function() { await closeToolbox(); hud = await openConsole(tab); - await waitFor(() => findMessage(hud, EXPECTED_REPORT)); - await waitFor(() => findMessage(hud, CACHED_MESSAGE)); + await waitFor(() => findErrorMessage(hud, EXPECTED_REPORT)); + await waitFor(() => findConsoleAPIMessage(hud, CACHED_MESSAGE)); info( "Click the clear output button and wait until there's no messages in the output" @@ -37,12 +37,12 @@ add_task(async function() { info("Log a smoke message in order to know that the console is ready"); await logTextToConsole(hud, "Smoke message"); is( - findMessage(hud, CACHED_MESSAGE), + findConsoleAPIMessage(hud, CACHED_MESSAGE), undefined, "The cached message is not visible anymore" ); is( - findMessage(hud, EXPECTED_REPORT), + findErrorMessage(hud, EXPECTED_REPORT), undefined, "The cached error message is not visible anymore as well" ); @@ -65,7 +65,7 @@ add_task(async function() { info("Log a smoke message in order to know that the console is ready"); await logTextToConsole(hud, "Second smoke message"); is( - findMessage(hud, NEW_CACHED_MESSAGE), + findConsoleAPIMessage(hud, NEW_CACHED_MESSAGE), undefined, "The new cached message is not visible anymore" ); diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_clickable_urls.js b/devtools/client/webconsole/test/browser/browser_webconsole_clickable_urls.js index 1509fad7b353..86f341df5427 100644 --- a/devtools/client/webconsole/test/browser/browser_webconsole_clickable_urls.js +++ b/devtools/client/webconsole/test/browser/browser_webconsole_clickable_urls.js @@ -24,7 +24,7 @@ add_task(async function() { } ); - const node = await waitFor(() => findMessage(hud, firstURL)); + const node = await waitFor(() => findConsoleAPIMessage(hud, firstURL)); const [urlEl1, urlEl2] = Array.from(node.querySelectorAll("a.url")); let onTabLoaded = BrowserTestUtils.waitForNewTab(gBrowser, firstURL, true); diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_close_groups_after_navigation.js b/devtools/client/webconsole/test/browser/browser_webconsole_close_groups_after_navigation.js index 4e35de7845da..9f514242c9ae 100644 --- a/devtools/client/webconsole/test/browser/browser_webconsole_close_groups_after_navigation.js +++ b/devtools/client/webconsole/test/browser/browser_webconsole_close_groups_after_navigation.js @@ -12,7 +12,7 @@ add_task(async function() { "Open the console and wait for the console.group message to be rendered" ); const hud = await openNewTabAndConsole(TEST_URI); - await waitFor(() => findMessage(hud, "hello", ".startGroup")); + await waitFor(() => findConsoleAPIMessage(hud, "hello", ".startGroup")); info("Refresh tab several times and check for correct message indentation"); for (let i = 0; i < 5; i++) { diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_console_api_iframe.js b/devtools/client/webconsole/test/browser/browser_webconsole_console_api_iframe.js index f5e23a182bb5..75971e463a8b 100644 --- a/devtools/client/webconsole/test/browser/browser_webconsole_console_api_iframe.js +++ b/devtools/client/webconsole/test/browser/browser_webconsole_console_api_iframe.js @@ -13,7 +13,7 @@ add_task(async function() { const hud = await openNewTabAndConsole(TEST_URI); const loggedString = "iframe added"; // Wait for the initial message to be displayed. - await waitFor(() => findMessage(hud, loggedString)); + await waitFor(() => findConsoleAPIMessage(hud, loggedString)); ok(true, "The initial message is displayed in the console"); // Create a promise for the message logged after the reload. const onMessage = waitForMessage(hud, loggedString); diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_console_group.js b/devtools/client/webconsole/test/browser/browser_webconsole_console_group.js index b1be2501545e..327ac558033a 100644 --- a/devtools/client/webconsole/test/browser/browser_webconsole_console_group.js +++ b/devtools/client/webconsole/test/browser/browser_webconsole_console_group.js @@ -25,7 +25,7 @@ add_task(async function() { await onMessagesLogged; info("Test a group at root level"); - let node = findMessage(hud, "group-1"); + let node = findConsoleAPIMessage(hud, "group-1"); testClass(node, "startGroup"); testIndent(node, 0); await testGroupToggle({ @@ -37,12 +37,12 @@ add_task(async function() { }); info("Test a message in a 1 level deep group"); - node = findMessage(hud, "log-1"); + node = findConsoleAPIMessage(hud, "log-1"); testClass(node, "log"); testIndent(node, 1); info("Test a group in a 1 level deep group"); - node = findMessage(hud, "group-2"); + node = findConsoleAPIMessage(hud, "group-2"); testClass(node, "startGroup"); testIndent(node, 1); await testGroupToggle({ @@ -54,24 +54,24 @@ add_task(async function() { }); info("Test a message in a 2 level deep group"); - node = findMessage(hud, "log-2"); + node = findConsoleAPIMessage(hud, "log-2"); testClass(node, "log"); testIndent(node, 2); info( "Test a message in a 1 level deep group, after closing a 2 level deep group" ); - node = findMessage(hud, "log-3"); + node = findConsoleAPIMessage(hud, "log-3"); testClass(node, "log"); testIndent(node, 1); info("Test a message at root level, after closing all the groups"); - node = findMessage(hud, "log-4"); + node = findConsoleAPIMessage(hud, "log-4"); testClass(node, "log"); testIndent(node, 0); info("Test a collapsed group at root level"); - node = findMessage(hud, "group-3"); + node = findConsoleAPIMessage(hud, "group-3"); testClass(node, "startGroupCollapsed"); testIndent(node, 0); await testGroupToggle({ @@ -93,7 +93,7 @@ add_task(async function() { }); info("Test a message at root level, after closing a collapsed group"); - node = findMessage(hud, "log-6"); + node = findConsoleAPIMessage(hud, "log-6"); testClass(node, "log"); testIndent(node, 0); const nodes = hud.ui.outputNode.querySelectorAll(".message"); diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_console_group_open_no_scroll.js b/devtools/client/webconsole/test/browser/browser_webconsole_console_group_open_no_scroll.js index 613b45641e35..fef3f2c115ec 100644 --- a/devtools/client/webconsole/test/browser/browser_webconsole_console_group_open_no_scroll.js +++ b/devtools/client/webconsole/test/browser/browser_webconsole_console_group_open_no_scroll.js @@ -16,8 +16,8 @@ add_task(async function() { const outputScroller = hud.ui.outputScroller; // Let's wait until the first message and the group are displayed. - await waitFor(() => findMessage(hud, "log-0")); - const groupMessage = await waitFor(() => findMessage(hud, "GROUP")); + await waitFor(() => findConsoleAPIMessage(hud, "log-0")); + const groupMessage = await waitFor(() => findConsoleAPIMessage(hud, "GROUP")); is(hasVerticalOverflow(outputScroller), true, "output node overflows"); is( @@ -28,7 +28,7 @@ add_task(async function() { info("Expand the group"); groupMessage.querySelector(".arrow").click(); - await waitFor(() => findMessage(hud, "in group")); + await waitFor(() => findConsoleAPIMessage(hud, "in group")); is(hasVerticalOverflow(outputScroller), true, "output node overflows"); is( diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_console_logging_workers_api.js b/devtools/client/webconsole/test/browser/browser_webconsole_console_logging_workers_api.js index 9f937e0dc2f8..3f8be177d58f 100644 --- a/devtools/client/webconsole/test/browser/browser_webconsole_console_logging_workers_api.js +++ b/devtools/client/webconsole/test/browser/browser_webconsole_console_logging_workers_api.js @@ -23,7 +23,7 @@ async function testWorkerMessage(directConnectionToWorkerThread = false) { const hud = await openNewTabAndConsole(TEST_URI); const cachedMessage = await waitFor(() => - findMessage(hud, "initial-message-from-worker") + findConsoleAPIMessage(hud, "initial-message-from-worker") ); ok(true, "We get the cached message from the worker"); @@ -50,7 +50,9 @@ async function testWorkerMessage(directConnectionToWorkerThread = false) { content.wrappedJSObject.logFromWorker("live-message"); }); - const liveMessage = await waitFor(() => findMessage(hud, "log-from-worker")); + const liveMessage = await waitFor(() => + findConsoleAPIMessage(hud, "log-from-worker") + ); ok(true, "We get the cached message from the worker"); ok( @@ -75,7 +77,7 @@ async function testWorkerMessage(directConnectionToWorkerThread = false) { }); const symbolMessage = await waitFor(() => - findMessage(hud, 'Symbol("logged-symbol-from-worker")') + findConsoleAPIMessage(hud, 'Symbol("logged-symbol-from-worker")') ); ok(symbolMessage, "Symbol logged from worker is visible in the console"); } @@ -84,8 +86,8 @@ async function testWorkerMessage(directConnectionToWorkerThread = false) { hud.ui.window.document.querySelector(".devtools-clear-icon").click(); await waitFor( () => - !findMessage(hud, "initial-message-from-worker") && - !findMessage(hud, "log-from-worker") + !findConsoleAPIMessage(hud, "initial-message-from-worker") && + !findConsoleAPIMessage(hud, "log-from-worker") ); ok(true, "Messages were removed"); @@ -104,12 +106,12 @@ async function testWorkerMessage(directConnectionToWorkerThread = false) { await onSmokeMessage; is( - findMessage(newHud, "initial-message-from-worker"), + findConsoleAPIMessage(newHud, "initial-message-from-worker"), undefined, "Message cache was cleared" ); is( - findMessage(newHud, "log-from-worker"), + findConsoleAPIMessage(newHud, "log-from-worker"), undefined, "Live message were cleared as well" ); diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_console_profile_unavailable.js b/devtools/client/webconsole/test/browser/browser_webconsole_console_profile_unavailable.js index 1a67d47d650e..4033b606b38a 100644 --- a/devtools/client/webconsole/test/browser/browser_webconsole_console_profile_unavailable.js +++ b/devtools/client/webconsole/test/browser/browser_webconsole_console_profile_unavailable.js @@ -19,7 +19,7 @@ add_task(async function consoleProfileWarningWithNewPerfPanel() { }); await waitFor( - () => findMessage(hud, EXPECTED_WARNING), + () => findWarningMessage(hud, EXPECTED_WARNING), "Wait until the warning about console.profile is displayed" ); ok(true, "The expected warning was displayed."); diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_console_table_fallback.js b/devtools/client/webconsole/test/browser/browser_webconsole_console_table_fallback.js index e459b63d45d7..ba7b6d2b2edd 100644 --- a/devtools/client/webconsole/test/browser/browser_webconsole_console_table_fallback.js +++ b/devtools/client/webconsole/test/browser/browser_webconsole_console_table_fallback.js @@ -27,7 +27,7 @@ add_task(async function() { for (const [input, output] of tests) { execute(hud, input); const message = await waitFor( - () => findMessage(hud, output, ".console-api"), + () => findConsoleAPIMessage(hud, output), `Waiting for output for ${input}` ); diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_console_trace_distinct.js b/devtools/client/webconsole/test/browser/browser_webconsole_console_trace_distinct.js index 99b123af7eb8..481c896c8390 100644 --- a/devtools/client/webconsole/test/browser/browser_webconsole_console_trace_distinct.js +++ b/devtools/client/webconsole/test/browser/browser_webconsole_console_trace_distinct.js @@ -14,9 +14,9 @@ const TEST_URI = `data:text/html,