mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
Bug 1241141 - remove Synced Tabs item from history panel. r=Gijs
This commit is contained in:
parent
61b99aec71
commit
ca1909f987
@ -246,13 +246,6 @@ const CustomizableWidgets = [
|
||||
recentlyClosedWindows.removeChild(recentlyClosedWindows.firstChild);
|
||||
}
|
||||
|
||||
let tabsFromOtherComputers = doc.getElementById("sync-tabs-menuitem2");
|
||||
if (PlacesUIUtils.shouldShowTabsFromOtherComputersMenuitem()) {
|
||||
tabsFromOtherComputers.removeAttribute("hidden");
|
||||
} else {
|
||||
tabsFromOtherComputers.setAttribute("hidden", true);
|
||||
}
|
||||
|
||||
let utils = RecentlyClosedTabsAndWindowsMenuUtils;
|
||||
let tabsFragment = utils.getTabsFragment(doc.defaultView, "toolbarbutton", true,
|
||||
"menuRestoreAllTabsSubview.label");
|
||||
|
@ -84,11 +84,6 @@
|
||||
label="&appMenuHistory.clearRecent.label;"
|
||||
class="subviewbutton"
|
||||
command="Tools:Sanitize"/>
|
||||
<toolbarbutton id="sync-tabs-menuitem2"
|
||||
class="syncTabsMenuItem subviewbutton"
|
||||
label="&syncTabsMenu3.label;"
|
||||
oncommand="BrowserOpenSyncTabs();"
|
||||
hidden="true"/>
|
||||
<toolbarbutton id="appMenuRestoreLastSession"
|
||||
label="&appMenuHistory.restoreSession.label;"
|
||||
class="subviewbutton"
|
||||
|
@ -51,9 +51,6 @@ skip-if = os == "linux"
|
||||
# Because this test is about the menubar, it can't be run on mac
|
||||
skip-if = os == "mac"
|
||||
|
||||
[browser_946320_tabs_from_other_computers.js]
|
||||
skip-if = os == "linux"
|
||||
|
||||
[browser_934951_zoom_in_toolbar.js]
|
||||
[browser_938980_navbar_collapsed.js]
|
||||
[browser_938995_indefaultstate_nonremovable.js]
|
||||
|
@ -1,144 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
var Preferences = Cu.import("resource://gre/modules/Preferences.jsm", {}).Preferences;
|
||||
|
||||
const {FxAccounts, AccountState} = Cu.import("resource://gre/modules/FxAccounts.jsm", {});
|
||||
|
||||
// FxA logs can be gotten at via this pref which helps debugging.
|
||||
Preferences.set("services.sync.log.appender.dump", "Debug");
|
||||
|
||||
add_task(function*() {
|
||||
yield PanelUI.show({type: "command"});
|
||||
|
||||
let historyButton = document.getElementById("history-panelmenu");
|
||||
let historySubview = document.getElementById("PanelUI-history");
|
||||
let subviewShownPromise = subviewShown(historySubview);
|
||||
historyButton.click();
|
||||
yield subviewShownPromise;
|
||||
|
||||
let tabsFromOtherComputers = document.getElementById("sync-tabs-menuitem2");
|
||||
is(tabsFromOtherComputers.hidden, true, "The Tabs From Other Computers menuitem should be hidden when sync isn't enabled.");
|
||||
|
||||
let hiddenPanelPromise = promisePanelHidden(window);
|
||||
PanelUI.hide();
|
||||
yield hiddenPanelPromise;
|
||||
|
||||
// Part 2 - When Sync is enabled the menuitem should be shown.
|
||||
yield configureIdentity();
|
||||
yield PanelUI.show({type: "command"});
|
||||
|
||||
subviewShownPromise = subviewShown(historySubview);
|
||||
historyButton.click();
|
||||
yield subviewShownPromise;
|
||||
|
||||
is(tabsFromOtherComputers.hidden, false, "The Tabs From Other Computers menuitem should be shown when sync is enabled.");
|
||||
|
||||
let syncPrefBranch = new Preferences("services.sync.");
|
||||
syncPrefBranch.resetBranch("");
|
||||
Services.logins.removeAllLogins();
|
||||
|
||||
hiddenPanelPromise = promisePanelHidden(window);
|
||||
PanelUI.toggle({type: "command"});
|
||||
yield hiddenPanelPromise;
|
||||
|
||||
yield fxAccounts.signOut(/*localOnly = */true);
|
||||
});
|
||||
|
||||
function configureIdentity() {
|
||||
// do the FxAccounts thang and wait for Sync to initialize the identity.
|
||||
configureFxAccountIdentity();
|
||||
return Weave.Service.identity.initializeWithCurrentIdentity().then(() => {
|
||||
// need to wait until this identity manager is readyToAuthenticate.
|
||||
return Weave.Service.identity.whenReadyToAuthenticate.promise;
|
||||
});
|
||||
}
|
||||
|
||||
// Configure an instance of an FxAccount identity provider.
|
||||
function configureFxAccountIdentity() {
|
||||
// A mock "storage manager" for FxAccounts that doesn't actually write anywhere.
|
||||
function MockFxaStorageManager() {
|
||||
}
|
||||
|
||||
MockFxaStorageManager.prototype = {
|
||||
promiseInitialized: Promise.resolve(),
|
||||
|
||||
initialize(accountData) {
|
||||
this.accountData = accountData;
|
||||
},
|
||||
|
||||
finalize() {
|
||||
return Promise.resolve();
|
||||
},
|
||||
|
||||
getAccountData() {
|
||||
return Promise.resolve(this.accountData);
|
||||
},
|
||||
|
||||
updateAccountData(updatedFields) {
|
||||
for (let [name, value] of Iterator(updatedFields)) {
|
||||
if (value == null) {
|
||||
delete this.accountData[name];
|
||||
} else {
|
||||
this.accountData[name] = value;
|
||||
}
|
||||
}
|
||||
return Promise.resolve();
|
||||
},
|
||||
|
||||
deleteAccountData() {
|
||||
this.accountData = null;
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
|
||||
let user = {
|
||||
assertion: "assertion",
|
||||
email: "email",
|
||||
kA: "kA",
|
||||
kB: "kB",
|
||||
sessionToken: "sessionToken",
|
||||
uid: "user_uid",
|
||||
verified: true,
|
||||
};
|
||||
|
||||
let token = {
|
||||
endpoint: null,
|
||||
duration: 300,
|
||||
id: "id",
|
||||
key: "key",
|
||||
// uid will be set to the username.
|
||||
};
|
||||
|
||||
let MockInternal = {
|
||||
newAccountState(credentials) {
|
||||
isnot(credentials, "not expecting credentials");
|
||||
let storageManager = new MockFxaStorageManager();
|
||||
// and init storage with our user.
|
||||
storageManager.initialize(user);
|
||||
return new AccountState(storageManager);
|
||||
},
|
||||
_getAssertion(audience) {
|
||||
return Promise.resolve("assertion");
|
||||
},
|
||||
getCertificateSigned() {
|
||||
return Promise.resolve();
|
||||
},
|
||||
};
|
||||
let mockTSC = { // TokenServerClient
|
||||
getTokenFromBrowserIDAssertion: function(uri, assertion, cb) {
|
||||
token.uid = "username";
|
||||
cb(null, token);
|
||||
},
|
||||
};
|
||||
|
||||
let fxa = new FxAccounts(MockInternal);
|
||||
Weave.Service.identity._fxaService = fxa;
|
||||
Weave.Service.identity._tokenServerClient = mockTSC;
|
||||
// Set the "account" of the browserId manager to be the "email" of the
|
||||
// logged in user of the mockFXA service.
|
||||
Weave.Service.identity._account = user.email;
|
||||
}
|
@ -786,7 +786,7 @@ you can use these alternative items. Otherwise, their values should be empty. -
|
||||
The word "toolbar" is appended automatically and should not be contained below! -->
|
||||
<!ENTITY tabsToolbar.label "Browser tabs">
|
||||
|
||||
<!-- LOCALIZATION NOTE (syncTabsMenu3.label): This appears in the history menu and history panel -->
|
||||
<!-- LOCALIZATION NOTE (syncTabsMenu3.label): This appears in the history menu -->
|
||||
<!ENTITY syncTabsMenu3.label "Synced Tabs">
|
||||
|
||||
<!ENTITY syncedTabs.sidebar.label "Synced Tabs">
|
||||
|
Loading…
Reference in New Issue
Block a user