Skip to content

Commit

Permalink
Bug 1565010 - Fix intermittent on browser_webconsole_warn_about_repla…
Browse files Browse the repository at this point in the history
…ced_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
  • Loading branch information
marco-c committed Apr 25, 2020
1 parent e737ab1 commit dd68fdf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ const TEST_URI_NOT_REPLACED =
"data:text/html;charset=utf8,<script>console.log('foo')</script>";

add_task(async function() {
await SpecialPowers.pushPrefEnv({
set: [["devtools.webconsole.persistlog", true]],
});
await pushPref("devtools.webconsole.timestampMessages", true);
await pushPref("devtools.webconsole.persistlog", true);

let hud = await openNewTabAndConsole(TEST_URI_NOT_REPLACED);

Expand Down
7 changes: 4 additions & 3 deletions devtools/client/webconsole/webconsole-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -589,13 +589,14 @@ class WebConsoleUI {


async handleTabNavigated(packet) {


await this.wrapper.waitAsyncDispatches();

if (!packet.nativeConsoleAPI) {
this.logWarningAboutReplacedAPI();
}



await this.wrapper.waitAsyncDispatches();
this.emit("reloaded");
}

Expand Down

0 comments on commit dd68fdf

Please sign in to comment.