mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 16:25:38 +00:00
Bug 1566850 - Remove target.activeConsole usage in Netmonitor. r=Honza.
Differential Revision: https://phabricator.services.mozilla.com/D56689 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
018643b9e6
commit
684b113226
@ -81,7 +81,8 @@ if (window.location.protocol === "chrome:" && url.search.length > 1) {
|
||||
const target = await targetFromURL(url);
|
||||
|
||||
// Start the network event listening as it is done in the toolbox code
|
||||
await target.activeConsole.startListeners(["NetworkActivity"]);
|
||||
const consoleFront = await target.getFront("console");
|
||||
await consoleFront.startListeners(["NetworkActivity"]);
|
||||
|
||||
// Create a fake toolbox object
|
||||
const toolbox = {
|
||||
|
@ -58,7 +58,7 @@ class FirefoxConnector {
|
||||
// The owner object (NetMonitorAPI) received all events.
|
||||
this.owner = connection.owner;
|
||||
|
||||
this.webConsoleFront = this.tabTarget.activeConsole;
|
||||
this.webConsoleFront = await this.tabTarget.getFront("console");
|
||||
|
||||
this.dataProvider = new FirefoxDataProvider({
|
||||
webConsoleFront: this.webConsoleFront,
|
||||
|
@ -59,13 +59,13 @@ HarAutomation.prototype = {
|
||||
|
||||
// Automation
|
||||
|
||||
startMonitoring: function(client, callback) {
|
||||
startMonitoring: async function(client, callback) {
|
||||
if (!client) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.debuggerClient = client;
|
||||
this.webConsoleFront = this.toolbox.target.activeConsole;
|
||||
this.webConsoleFront = await this.toolbox.target.getFront("console");
|
||||
|
||||
this.tabWatcher = new TabWatcher(this.toolbox, this);
|
||||
this.tabWatcher.connect();
|
||||
|
@ -362,15 +362,18 @@ function initNetMonitor(url, enableCache) {
|
||||
info(
|
||||
"Cache disabled when the current and all future toolboxes are open."
|
||||
);
|
||||
|
||||
const consoleFront = await target.getFront("console");
|
||||
|
||||
// Remove any requests generated by the reload while toggling the cache to
|
||||
// avoid interfering with the test.
|
||||
isnot(
|
||||
[...target.activeConsole.getNetworkEvents()].length,
|
||||
[...consoleFront.getNetworkEvents()].length,
|
||||
0,
|
||||
"Request to reconfigure the tab was recorded."
|
||||
);
|
||||
info("Clearing requests in the console client.");
|
||||
target.activeConsole.clearNetworkRequests();
|
||||
await consoleFront.clearNetworkRequests();
|
||||
info("Clearing requests in the UI.");
|
||||
|
||||
store.dispatch(Actions.clearRequests());
|
||||
|
Loading…
Reference in New Issue
Block a user