Bug 1485660 - Adapt TabClient API to protocol one. r=jdescottes

MozReview-Commit-ID: 1dC5opkgLcQ

Depends on D7459

Differential Revision: https://phabricator.services.mozilla.com/D8066

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Alexandre Poirot 2018-10-15 08:36:12 +00:00
Родитель bbd1bcdcbe
Коммит 2bab2fef72
15 изменённых файлов: 30 добавлений и 20 удалений

Просмотреть файл

@ -408,6 +408,6 @@ function reload(target, waitForTargetEvent = "navigate") {
* @param {String} waitForTargetEvent Event to wait for after reload.
*/
function navigate(target, url, waitForTargetEvent = "navigate") {
executeSoon(() => target.activeTab.navigateTo(url));
executeSoon(() => target.activeTab.navigateTo({ url }));
return once(target, waitForTargetEvent);
}

Просмотреть файл

@ -41,7 +41,7 @@ function getWorkerContainers(doc) {
}
function navigate(target, url, waitForTargetEvent = "navigate") {
executeSoon(() => target.activeTab.navigateTo(url));
executeSoon(() => target.activeTab.navigateTo({ url }));
return once(target, waitForTargetEvent);
}

Просмотреть файл

@ -107,7 +107,7 @@ function navigateInHistory(aTarget, aDirection, aWaitForTargetEvent = "navigate"
}
function navigate(aTarget, aUrl, aWaitForTargetEvent = "navigate") {
executeSoon(() => aTarget.activeTab.navigateTo(aUrl));
executeSoon(() => aTarget.activeTab.navigateTo({ url: aUrl }));
return once(aTarget, aWaitForTargetEvent);
}

Просмотреть файл

@ -247,7 +247,7 @@ function debuggeeCommand(script) {
}
function navigate(url) {
return tabTarget.activeTab.navigateTo(url);
return tabTarget.activeTab.navigateTo({ url });
}
function reload() {
@ -455,4 +455,4 @@ const clientCommands = {
setSkipPausing
};
exports.setupCommands = setupCommands;
exports.clientCommands = clientCommands;
exports.clientCommands = clientCommands;

Просмотреть файл

@ -76,7 +76,7 @@ add_task(async function() {
);
info("Disable HTTP cache for page");
await toolbox.target.activeTab.reconfigure({ cacheDisabled: true });
await toolbox.target.activeTab.reconfigure({ options: { cacheDisabled: true } });
makeChanges();
info("Reload inside debugger with toolbox caching disabled (attempt 1)");
@ -106,7 +106,7 @@ add_task(async function() {
);
info("Enable HTTP cache for page");
await toolbox.target.activeTab.reconfigure({ cacheDisabled: false });
await toolbox.target.activeTab.reconfigure({ options: { cacheDisabled: false } });
makeChanges();
// Even though the HTTP cache is now enabled, Gecko sets the VALIDATE_ALWAYS flag when

Просмотреть файл

@ -450,7 +450,7 @@ function ensureThreadClientState(aPanel, aState) {
function reload(aPanel, aUrl) {
let activeTab = aPanel.panelWin.DebuggerController._target.activeTab;
aUrl ? activeTab.navigateTo(aUrl) : activeTab.reload();
aUrl ? activeTab.navigateTo({ url: aUrl }) : activeTab.reload();
}
function navigateActiveTabTo(aPanel, aUrl, aWaitForEventName, aEventRepeat) {

Просмотреть файл

@ -828,7 +828,7 @@ TabTarget.prototype = {
logErrorInPage: function(text, category) {
if (this.activeTab && this.activeTab.traits.logInPage) {
const errorFlag = 0;
this.activeTab.logInPage(text, category, errorFlag);
this.activeTab.logInPage({ text, category, flags: errorFlag });
}
},
@ -843,7 +843,7 @@ TabTarget.prototype = {
logWarningInPage: function(text, category) {
if (this.activeTab && this.activeTab.traits.logInPage) {
const warningFlag = 1;
this.activeTab.logInPage(text, category, warningFlag);
this.activeTab.logInPage({ text, category, flags: warningFlag });
}
},
};

Просмотреть файл

@ -512,7 +512,7 @@ OptionsPanel.prototype = {
"javascriptEnabled": !checked
};
this.target.activeTab.reconfigure(options);
this.target.activeTab.reconfigure({ options });
},
destroy: function() {

Просмотреть файл

@ -1344,7 +1344,11 @@ Toolbox.prototype = {
const cacheDisabled = Services.prefs.getBoolPref(pref);
if (this.target.activeTab) {
this.target.activeTab.reconfigure({"cacheDisabled": cacheDisabled});
this.target.activeTab.reconfigure({
options: {
"cacheDisabled": cacheDisabled
}
});
}
},
@ -1359,7 +1363,9 @@ Toolbox.prototype = {
if (this.target.activeTab) {
this.target.activeTab.reconfigure({
"serviceWorkersTestingEnabled": serviceWorkersTestingEnabled
options: {
"serviceWorkersTestingEnabled": serviceWorkersTestingEnabled
}
});
}
},
@ -1405,7 +1411,11 @@ Toolbox.prototype = {
this.telemetry.toolClosed("paintflashing", this.sessionId, this);
}
this.isPaintFlashing = !this.isPaintFlashing;
return this.target.activeTab.reconfigure({"paintFlashing": this.isPaintFlashing});
return this.target.activeTab.reconfigure({
options: {
"paintFlashing": this.isPaintFlashing
}
});
},
/**

Просмотреть файл

@ -42,7 +42,7 @@ add_task(async function() {
info("Navigate to the slow loading page");
const activeTab = inspector.toolbox.target.activeTab;
await activeTab.navigateTo(TEST_URL);
await activeTab.navigateTo({ url: TEST_URL });
info("Wait for request made to the image");
const response = await onRequest;

Просмотреть файл

@ -48,7 +48,7 @@ var navigateTo = async function(inspector, url) {
info("Navigating to: " + url);
const activeTab = inspector.toolbox.target.activeTab;
await activeTab.navigateTo(url);
await activeTab.navigateTo({ url });
info("Waiting for markup view to load after navigation.");
await markuploaded;

Просмотреть файл

@ -316,7 +316,7 @@ class FirefoxConnector {
// Reconfigures the tab, optionally triggering a reload.
const reconfigureTab = options => {
return this.tabTarget.activeTab.reconfigure(options);
return this.tabTarget.activeTab.reconfigure({ options });
};
// Reconfigures the tab and waits for the target to finish navigating.

Просмотреть файл

@ -144,7 +144,7 @@ function toggleCache(target, disabled) {
// Disable the cache for any toolbox that it is opened from this point on.
Services.prefs.setBoolPref("devtools.cache.disabled", disabled);
return target.activeTab.reconfigure(options).then(() => navigationFinished);
return target.activeTab.reconfigure({ options }).then(() => navigationFinished);
}
/**

Просмотреть файл

@ -131,7 +131,7 @@ function navigateInHistory(aTarget, aDirection, aWaitForTargetEvent = "navigate"
}
function navigate(aTarget, aUrl, aWaitForTargetEvent = "navigate") {
executeSoon(() => aTarget.activeTab.navigateTo(aUrl));
executeSoon(() => aTarget.activeTab.navigateTo({ url: aUrl }));
return once(aTarget, aWaitForTargetEvent);
}

Просмотреть файл

@ -48,7 +48,7 @@ function reload(aTarget, aWaitForTargetEvent = "navigate") {
}
function navigate(aTarget, aUrl, aWaitForTargetEvent = "navigate") {
executeSoon(() => aTarget.activeTab.navigateTo(aUrl));
executeSoon(() => aTarget.activeTab.navigateTo({ url: aUrl }));
return once(aTarget, aWaitForTargetEvent);
}