Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 04d59f8

Browse files
committed
Bug 1565010 - Fix intermittent on browser_webconsole_warn_about_replaced_api.js .r=Honza.
Log the console replaced message only after the current batch of messages are consumed. We also enable the timestamp in the test, so in case of failure we can diagnose what's going on better. Differential Revision: https://phabricator.services.mozilla.com/D72121
1 parent 20be49d commit 04d59f8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

devtools/client/webconsole/test/browser/browser_webconsole_warn_about_replaced_api.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ const TEST_URI_NOT_REPLACED =
99
"data:text/html;charset=utf8,<script>console.log('foo')</script>";
1010

1111
add_task(async function() {
12-
await SpecialPowers.pushPrefEnv({
13-
set: [["devtools.webconsole.persistlog", true]],
14-
});
12+
await pushPref("devtools.webconsole.timestampMessages", true);
13+
await pushPref("devtools.webconsole.persistlog", true);
1514

1615
let hud = await openNewTabAndConsole(TEST_URI_NOT_REPLACED);
1716

devtools/client/webconsole/webconsole-ui.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -589,13 +589,14 @@ class WebConsoleUI {
589589
* Notification packet received from the server.
590590
*/
591591
async handleTabNavigated(packet) {
592+
// Wait for completion of any async dispatch before notifying that the console
593+
// is fully updated after a page reload
594+
await this.wrapper.waitAsyncDispatches();
595+
592596
if (!packet.nativeConsoleAPI) {
593597
this.logWarningAboutReplacedAPI();
594598
}
595599

596-
// Wait for completion of any async dispatch before notifying that the console
597-
// is fully updated after a page reload
598-
await this.wrapper.waitAsyncDispatches();
599600
this.emit("reloaded");
600601
}
601602

0 commit comments

Comments
 (0)