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
  • Loading branch information
nchevobbe committed Apr 23, 2020
1 parent 20be49d commit 04d59f8
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 {
* Notification packet received from the server.
*/
async handleTabNavigated(packet) {
// Wait for completion of any async dispatch before notifying that the console
// is fully updated after a page reload
await this.wrapper.waitAsyncDispatches();

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

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

Expand Down

0 comments on commit 04d59f8

Please sign in to comment.