mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1195150 - Persist the tab muted state in the session store; r=billm
The muted state is state that belong to the whole tab, and it would be nice if it was integrated with undo close tab and session restore.
This commit is contained in:
parent
86c13c8ffb
commit
08c515de22
@ -70,6 +70,12 @@ function* test_mute_tab(tab, icon, expectMuted) {
|
||||
return mutedPromise;
|
||||
}
|
||||
|
||||
function get_tab_attributes(tab) {
|
||||
const ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
||||
let {attributes} = JSON.parse(ss.getTabState(tab));
|
||||
return attributes;
|
||||
}
|
||||
|
||||
function* test_playing_icon_on_tab(tab, browser, isPinned) {
|
||||
let icon = document.getAnonymousElementByAttribute(tab, "anonid",
|
||||
isPinned ? "overlay-icon" : "soundplaying-icon");
|
||||
@ -83,12 +89,18 @@ function* test_playing_icon_on_tab(tab, browser, isPinned) {
|
||||
|
||||
yield test_tooltip(icon, "Mute tab");
|
||||
|
||||
ok(!("muted" in get_tab_attributes(tab)), "No muted attribute should be persisted");
|
||||
|
||||
yield test_mute_tab(tab, icon, true);
|
||||
|
||||
ok("muted" in get_tab_attributes(tab), "Muted attribute should be persisted");
|
||||
|
||||
yield test_tooltip(icon, "Unmute tab");
|
||||
|
||||
yield test_mute_tab(tab, icon, false);
|
||||
|
||||
ok(!("muted" in get_tab_attributes(tab)), "No muted attribute should be persisted");
|
||||
|
||||
yield test_tooltip(icon, "Mute tab");
|
||||
|
||||
yield test_mute_tab(tab, icon, true);
|
||||
|
@ -24,7 +24,7 @@ this.TabAttributes = Object.freeze({
|
||||
});
|
||||
|
||||
let TabAttributesInternal = {
|
||||
_attrs: new Set(),
|
||||
_attrs: new Set(["muted"]),
|
||||
|
||||
// We never want to directly read or write those attributes.
|
||||
// 'image' should not be accessed directly but handled by using the
|
||||
|
Loading…
Reference in New Issue
Block a user