mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out 8fdfa9d502f8 (bug 1190106) for M-e10s(bc2) bustage. r=backout
This commit is contained in:
parent
6331446163
commit
53ccef2a19
@ -2450,16 +2450,6 @@
|
|||||||
if (!remoteBrowser._beginRemoveTab(aOtherTab, true, true))
|
if (!remoteBrowser._beginRemoveTab(aOtherTab, true, true))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let modifiedAttrs = [];
|
|
||||||
if (aOtherTab.hasAttribute("muted")) {
|
|
||||||
aOurTab.setAttribute("muted", "true");
|
|
||||||
modifiedAttrs.push("muted");
|
|
||||||
}
|
|
||||||
if (aOtherTab.hasAttribute("soundplaying")) {
|
|
||||||
aOurTab.setAttribute("soundplaying", "true");
|
|
||||||
modifiedAttrs.push("soundplaying");
|
|
||||||
}
|
|
||||||
|
|
||||||
let ourBrowser = this.getBrowserForTab(aOurTab);
|
let ourBrowser = this.getBrowserForTab(aOurTab);
|
||||||
let otherBrowser = aOtherTab.linkedBrowser;
|
let otherBrowser = aOtherTab.linkedBrowser;
|
||||||
|
|
||||||
@ -2479,7 +2469,7 @@
|
|||||||
var isBusy = aOtherTab.hasAttribute("busy");
|
var isBusy = aOtherTab.hasAttribute("busy");
|
||||||
if (isBusy) {
|
if (isBusy) {
|
||||||
aOurTab.setAttribute("busy", "true");
|
aOurTab.setAttribute("busy", "true");
|
||||||
modifiedAttrs.push("busy");
|
this._tabAttrModified(aOurTab, ["busy"]);
|
||||||
if (aOurTab.selected)
|
if (aOurTab.selected)
|
||||||
this.mIsBusy = true;
|
this.mIsBusy = true;
|
||||||
}
|
}
|
||||||
@ -2509,10 +2499,6 @@
|
|||||||
// of replaceTabWithWindow), notify onLocationChange, etc.
|
// of replaceTabWithWindow), notify onLocationChange, etc.
|
||||||
if (aOurTab.selected)
|
if (aOurTab.selected)
|
||||||
this.updateCurrentBrowser(true);
|
this.updateCurrentBrowser(true);
|
||||||
|
|
||||||
if (modifiedAttrs.length) {
|
|
||||||
this._tabAttrModified(aOurTab, modifiedAttrs);
|
|
||||||
}
|
|
||||||
]]>
|
]]>
|
||||||
</body>
|
</body>
|
||||||
</method>
|
</method>
|
||||||
|
@ -106,56 +106,6 @@ function* test_playing_icon_on_tab(tab, browser, isPinned) {
|
|||||||
!tab.hasAttribute("soundplaying"), "Tab should not be be muted or playing");
|
!tab.hasAttribute("soundplaying"), "Tab should not be be muted or playing");
|
||||||
}
|
}
|
||||||
|
|
||||||
function* test_swapped_browser(oldTab, newBrowser, isPlaying) {
|
|
||||||
ok(oldTab.hasAttribute("muted"), "Expected the correct muted attribute on the old tab");
|
|
||||||
is(oldTab.hasAttribute("soundplaying"), isPlaying, "Expected the correct soundplaying attribute on the old tab");
|
|
||||||
|
|
||||||
let newTab = gBrowser.getTabForBrowser(newBrowser);
|
|
||||||
let attrChangePromise = BrowserTestUtils.waitForEvent(newTab, "TabAttrModified", false, event => {
|
|
||||||
return (event.detail.changed.indexOf("soundplaying") >= 0 || !isPlaying) &&
|
|
||||||
event.detail.changed.indexOf("muted") >= 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
gBrowser.swapBrowsersAndCloseOther(newTab, oldTab);
|
|
||||||
yield attrChangePromise;
|
|
||||||
|
|
||||||
ok(newTab.hasAttribute("muted"), "Expected the correct muted attribute on the new tab");
|
|
||||||
is(newTab.hasAttribute("soundplaying"), isPlaying, "Expected the correct soundplaying attribute on the new tab");
|
|
||||||
}
|
|
||||||
|
|
||||||
function* test_browser_swapping(tab, browser) {
|
|
||||||
// First, test swapping with a playing but muted tab.
|
|
||||||
yield ContentTask.spawn(browser, {}, function* () {
|
|
||||||
let audio = content.document.querySelector("audio");
|
|
||||||
audio.play();
|
|
||||||
});
|
|
||||||
yield wait_for_tab_playing_event(tab, true);
|
|
||||||
|
|
||||||
let icon = document.getAnonymousElementByAttribute(tab, "anonid",
|
|
||||||
"soundplaying-icon");
|
|
||||||
yield test_mute_tab(tab, icon, true);
|
|
||||||
|
|
||||||
yield BrowserTestUtils.withNewTab({
|
|
||||||
gBrowser,
|
|
||||||
url: "about:blank",
|
|
||||||
}, function*(newBrowser) {
|
|
||||||
yield test_swapped_browser(tab, newBrowser, true)
|
|
||||||
|
|
||||||
// Now, test swapping with a muted but not playing tab.
|
|
||||||
// Note that the tab remains muted, so we only need to pause playback.
|
|
||||||
tab = gBrowser.getTabForBrowser(newBrowser);
|
|
||||||
yield ContentTask.spawn(newBrowser, {}, function* () {
|
|
||||||
let audio = content.document.querySelector("audio");
|
|
||||||
audio.pause();
|
|
||||||
});
|
|
||||||
|
|
||||||
yield BrowserTestUtils.withNewTab({
|
|
||||||
gBrowser,
|
|
||||||
url: "about:blank",
|
|
||||||
}, newBrowser => test_swapped_browser(tab, newBrowser, false));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function* test_on_browser(browser) {
|
function* test_on_browser(browser) {
|
||||||
let tab = gBrowser.getTabForBrowser(browser);
|
let tab = gBrowser.getTabForBrowser(browser);
|
||||||
|
|
||||||
@ -175,8 +125,6 @@ function* test_on_browser(browser) {
|
|||||||
gBrowser,
|
gBrowser,
|
||||||
url: "data:text/html,test"
|
url: "data:text/html,test"
|
||||||
}, () => test_on_browser(browser));
|
}, () => test_on_browser(browser));
|
||||||
} else {
|
|
||||||
yield test_browser_swapping(tab, browser);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user