Skip to content

Commit dd68fdf

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 UltraBlame original commit: d321839de1603d8bf02752ebaa40434015149320
1 parent e737ab1 commit dd68fdf

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

590590

591591
async handleTabNavigated(packet) {
592+
593+
594+
await this.wrapper.waitAsyncDispatches();
595+
592596
if (!packet.nativeConsoleAPI) {
593597
this.logWarningAboutReplacedAPI();
594598
}
595599

596-
597-
598-
await this.wrapper.waitAsyncDispatches();
599600
this.emit("reloaded");
600601
}
601602

0 commit comments

Comments
 (0)