Bug 1420179 - support tab argument in devtools shared-head refreshTab;r=nchevobbe

The tab argument was unused in the method. All the call sites have been updated to
stop providing this argument. The method now supports an optional tab argument.
It defaults to the selected tab if no argument is provided.

MozReview-Commit-ID: 621dgljHdtD

--HG--
extra : rebase_source : 676c998cb4b2f126d9ee075760e2d7d30078344b
This commit is contained in:
Julian Descottes 2017-11-23 16:31:48 +01:00
parent 1767aea3bb
commit e735cf1383
8 changed files with 13 additions and 13 deletions

View File

@ -36,7 +36,7 @@ add_task(function* () {
// Reload the page. The sjs ensures that a different source file
// will be loaded.
sourceSeen = waitForSourceLoad(toolbox, JS_URL);
yield refreshTab(tab);
yield refreshTab();
yield sourceSeen;
info(`checking post-reload original location for ${JS_URL}:${GENERATED_LINE}`);

View File

@ -172,17 +172,17 @@ var removeTab = Task.async(function* (tab) {
});
/**
* Refresh the given tab.
* @param {Object} tab The tab to be refreshed.
* Refresh the provided tab.
* @param {Object} tab The tab to be refreshed. Defaults to the currently selected tab.
* @return Promise<undefined> resolved when the tab is successfully refreshed.
*/
var refreshTab = Task.async(function*(tab) {
var refreshTab = async function (tab = gBrowser.selectedTab) {
info("Refreshing tab.");
const finished = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
gBrowser.reloadTab(gBrowser.selectedTab);
yield finished;
gBrowser.reloadTab(tab);
await finished;
info("Tab finished refreshing.");
});
};
/**
* Simulate a key event from a <key> element.

View File

@ -62,7 +62,7 @@ add_task(function* () {
let onGridListRestored = waitUntilState(store, state =>
state.grids.length == 1 &&
state.grids[0].highlighted);
yield refreshTab(gBrowser.selectedTab);
yield refreshTab();
let { restored } = yield onStateRestored;
yield onGridListRestored;

View File

@ -25,7 +25,7 @@ add_task(function* () {
let target = TargetFactory.forTab(gBrowser.selectedTab);
yield gDevTools.closeToolbox(target);
yield refreshTab(gBrowser.selectedTab);
yield refreshTab();
info("Check that the flexbox highlighter can be displayed after reloading the page.");
yield checkFlexboxHighlighter();

View File

@ -44,7 +44,7 @@ add_task(function* () {
info("Reload the page, expect the highlighter to be displayed once again");
let onStateRestored = highlighters.once("flexbox-state-restored");
yield refreshTab(gBrowser.selectedTab);
yield refreshTab();
let { restored } = yield onStateRestored;
ok(restored, "The highlighter state was restored");

View File

@ -30,7 +30,7 @@ add_task(function* () {
let target = TargetFactory.forTab(gBrowser.selectedTab);
yield gDevTools.closeToolbox(target);
yield refreshTab(gBrowser.selectedTab);
yield refreshTab();
info("Check that the grid highlighter can be displayed after reloading the page");
yield checkGridHighlighter();

View File

@ -51,7 +51,7 @@ add_task(function* () {
info("Reload the page, expect the highlighter to be displayed once again");
let onStateRestored = highlighters.once("grid-state-restored");
yield refreshTab(gBrowser.selectedTab);
yield refreshTab();
let { restored } = yield onStateRestored;
ok(restored, "The highlighter state was restored");

View File

@ -58,7 +58,7 @@ this.test = makeMemoryTest(TEST_URL, function* ({ tab, panel }) {
w.toString(16)).join(", "));
is(startWindows.length, 1);
yield refreshTab(tab);
yield refreshTab();
const endWindows = yield getWindowsInSnapshot(front);
is(endWindows.length, 1);