mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 23:35:34 +00:00
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:
parent
1767aea3bb
commit
e735cf1383
@ -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}`);
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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");
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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");
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user