зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 004bfb67bff4 (bug 1584524) for browser chrome failures on browser_noLoginsView.js.
--HG-- extra : rebase_source : aed78db5e647745c606224f7ff2ed226312bf5e5
This commit is contained in:
Родитель
af6083b6c6
Коммит
7e75b9408e
|
@ -231,14 +231,11 @@ class AboutLoginsChild extends ActorChild {
|
|||
this.sendToContent("SetBreaches", message.data);
|
||||
break;
|
||||
case "AboutLogins:Setup":
|
||||
let waivedContent = Cu.waiveXrays(this.content);
|
||||
waivedContent.AboutLoginsUtils.masterPasswordEnabled =
|
||||
message.data.masterPasswordEnabled;
|
||||
waivedContent.AboutLoginsUtils.passwordRevealVisible =
|
||||
message.data.passwordRevealVisible;
|
||||
waivedContent.AboutLoginsUtils.importVisible =
|
||||
message.data.importVisible;
|
||||
this.sendToContent("Setup", message.data);
|
||||
Cu.waiveXrays(this.content).AboutLoginsUtils.masterPasswordEnabled =
|
||||
message.data.masterPasswordEnabled;
|
||||
Cu.waiveXrays(this.content).AboutLoginsUtils.passwordRevealVisible =
|
||||
message.data.passwordRevealVisible;
|
||||
break;
|
||||
case "AboutLogins:ShowLoginItemError":
|
||||
this.sendToContent("ShowLoginItemError", message.data);
|
||||
|
|
|
@ -11,7 +11,6 @@ const { XPCOMUtils } = ChromeUtils.import(
|
|||
);
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
AppConstants: "resource://gre/modules/AppConstants.jsm",
|
||||
E10SUtils: "resource://gre/modules/E10SUtils.jsm",
|
||||
LoginBreaches: "resource:///modules/LoginBreaches.jsm",
|
||||
LoginHelper: "resource://gre/modules/LoginHelper.jsm",
|
||||
|
@ -423,9 +422,6 @@ var AboutLoginsParent = {
|
|||
passwordRevealVisible: Services.policies.isAllowed(
|
||||
"passwordReveal"
|
||||
),
|
||||
importVisible:
|
||||
Services.policies.isAllowed("profileImport") &&
|
||||
AppConstants.platform != "linux",
|
||||
});
|
||||
|
||||
await this._sendAllLoginRelatedObjects(logins, messageManager);
|
||||
|
|
|
@ -140,9 +140,6 @@
|
|||
<a data-l10n-name="help-link" class="intro-help-link" target="_blank" rel="noreferrer"></a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="description intro-import-text" hidden data-l10n-id="about-logins-intro-import">
|
||||
<a data-l10n-name="import-link" href="#"></a>
|
||||
</p>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -12,9 +12,6 @@ export default class LoginIntro extends HTMLElement {
|
|||
let shadowRoot = this.attachShadow({ mode: "open" });
|
||||
document.l10n.connectRoot(shadowRoot);
|
||||
shadowRoot.appendChild(loginIntroTemplate.content.cloneNode(true));
|
||||
|
||||
this._importText = shadowRoot.querySelector(".intro-import-text");
|
||||
this._importText.addEventListener("click", this);
|
||||
}
|
||||
|
||||
focus() {
|
||||
|
@ -22,20 +19,6 @@ export default class LoginIntro extends HTMLElement {
|
|||
helpLink.focus();
|
||||
}
|
||||
|
||||
handleEvent(event) {
|
||||
if (
|
||||
event.currentTarget.classList.contains("intro-import-text") &&
|
||||
event.target.localName == "a"
|
||||
) {
|
||||
document.dispatchEvent(
|
||||
new CustomEvent("AboutLoginsImport", {
|
||||
bubbles: true,
|
||||
})
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
set supportURL(val) {
|
||||
this.shadowRoot.querySelector(".intro-help-link").setAttribute("href", val);
|
||||
}
|
||||
|
@ -52,8 +35,6 @@ export default class LoginIntro extends HTMLElement {
|
|||
this.shadowRoot
|
||||
.querySelector(".illustration")
|
||||
.classList.toggle("logged-in", syncState.loggedIn);
|
||||
|
||||
this._importText.hidden = !window.AboutLoginsUtils.importVisible;
|
||||
}
|
||||
}
|
||||
customElements.define("login-intro", LoginIntro);
|
||||
|
|
|
@ -12,92 +12,60 @@ add_task(async function setup() {
|
|||
});
|
||||
|
||||
add_task(async function test_no_logins_class() {
|
||||
let platform = { AppConstants };
|
||||
await ContentTask.spawn(
|
||||
gBrowser.selectedBrowser,
|
||||
platform,
|
||||
async aPlatform => {
|
||||
let loginList = content.document.querySelector("login-list");
|
||||
await ContentTask.spawn(gBrowser.selectedBrowser, null, async () => {
|
||||
let loginList = content.document.querySelector("login-list");
|
||||
|
||||
ok(
|
||||
content.document.documentElement.classList.contains("no-logins"),
|
||||
"root should be in no logins view"
|
||||
);
|
||||
ok(
|
||||
loginList.classList.contains("no-logins"),
|
||||
"login-list should be in no logins view"
|
||||
);
|
||||
ok(
|
||||
content.document.documentElement.classList.contains("no-logins"),
|
||||
"root should be in no logins view"
|
||||
);
|
||||
ok(
|
||||
loginList.classList.contains("no-logins"),
|
||||
"login-list should be in no logins view"
|
||||
);
|
||||
|
||||
let loginIntro = Cu.waiveXrays(
|
||||
content.document.querySelector("login-intro")
|
||||
);
|
||||
let loginItem = content.document.querySelector("login-item");
|
||||
let loginListIntro = loginList.shadowRoot.querySelector(".intro");
|
||||
let loginListList = loginList.shadowRoot.querySelector("ol");
|
||||
let loginIntro = Cu.waiveXrays(
|
||||
content.document.querySelector("login-intro")
|
||||
);
|
||||
let loginItem = content.document.querySelector("login-item");
|
||||
let loginListIntro = loginList.shadowRoot.querySelector(".intro");
|
||||
let loginListList = loginList.shadowRoot.querySelector("ol");
|
||||
|
||||
ok(
|
||||
!ContentTaskUtils.is_hidden(loginIntro),
|
||||
"login-intro should be shown in no logins view"
|
||||
);
|
||||
ok(
|
||||
!ContentTaskUtils.is_hidden(loginListIntro),
|
||||
"login-list intro should be shown in no logins view"
|
||||
);
|
||||
ok(
|
||||
!ContentTaskUtils.is_hidden(loginIntro),
|
||||
"login-intro should be shown in no logins view"
|
||||
);
|
||||
ok(
|
||||
!ContentTaskUtils.is_hidden(loginListIntro),
|
||||
"login-list intro should be shown in no logins view"
|
||||
);
|
||||
|
||||
ok(
|
||||
ContentTaskUtils.is_hidden(loginItem),
|
||||
"login-item should be hidden in no logins view"
|
||||
);
|
||||
ok(
|
||||
ContentTaskUtils.is_hidden(loginListList),
|
||||
"login-list logins list should be hidden in no logins view"
|
||||
);
|
||||
is(
|
||||
content.document.l10n.getAttributes(
|
||||
loginIntro.shadowRoot.querySelector(".heading")
|
||||
).id,
|
||||
"login-intro-heading",
|
||||
"The default message should be the non-logged-in message"
|
||||
);
|
||||
ok(
|
||||
ContentTaskUtils.is_hidden(loginItem),
|
||||
"login-item should be hidden in no logins view"
|
||||
);
|
||||
ok(
|
||||
ContentTaskUtils.is_hidden(loginListList),
|
||||
"login-list logins list should be hidden in no logins view"
|
||||
);
|
||||
is(
|
||||
content.document.l10n.getAttributes(
|
||||
loginIntro.shadowRoot.querySelector(".heading")
|
||||
).id,
|
||||
"login-intro-heading",
|
||||
"The default message should be the non-logged-in message"
|
||||
);
|
||||
|
||||
loginIntro.updateState(Cu.cloneInto({ loggedIn: true }, content));
|
||||
loginIntro.updateState(Cu.cloneInto({ loggedIn: true }, content));
|
||||
|
||||
is(
|
||||
content.document.l10n.getAttributes(
|
||||
loginIntro.shadowRoot.querySelector(".heading")
|
||||
).id,
|
||||
"about-logins-login-intro-heading-logged-in",
|
||||
"When logged in the message should update"
|
||||
);
|
||||
|
||||
is(
|
||||
ContentTaskUtils.is_hidden(
|
||||
loginIntro.shadowRoot.querySelector(".intro-import-text")
|
||||
),
|
||||
aPlatform == "linux",
|
||||
"the import link should be hidden on Linux builds"
|
||||
);
|
||||
if (aPlatform == "linux") {
|
||||
// End the test now for Linux since the link is hidden.
|
||||
return;
|
||||
}
|
||||
loginIntro.shadowRoot.querySelector(".intro-import-text > a").click();
|
||||
info("waiting for MigrationWizard to open");
|
||||
}
|
||||
);
|
||||
if (AppConstants.platform == "linux") {
|
||||
// End the test now for Linux since the link is hidden.
|
||||
return;
|
||||
}
|
||||
await TestUtils.waitForCondition(
|
||||
() => Services.wm.getMostRecentWindow("Browser:MigrationWizard"),
|
||||
"Migrator window opened"
|
||||
);
|
||||
let migratorWindow = Services.wm.getMostRecentWindow(
|
||||
"Browser:MigrationWizard"
|
||||
);
|
||||
ok(migratorWindow, "Migrator window opened");
|
||||
await BrowserTestUtils.closeWindow(migratorWindow);
|
||||
is(
|
||||
content.document.l10n.getAttributes(
|
||||
loginIntro.shadowRoot.querySelector(".heading")
|
||||
).id,
|
||||
"about-logins-login-intro-heading-logged-in",
|
||||
"When logged in the message should update"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
add_task(
|
||||
|
|
|
@ -42,10 +42,6 @@ add_task(async function test_open_import() {
|
|||
info("waiting for Import to get opened");
|
||||
let importWindow = await promiseImportWindow;
|
||||
ok(true, "Import opened");
|
||||
await TestUtils.waitForCondition(
|
||||
() => importWindow.document.readyState == "complete",
|
||||
"waiting for Import to fully load before closing it so observers will be correctly removed"
|
||||
);
|
||||
|
||||
importWindow.close();
|
||||
});
|
||||
|
|
|
@ -107,11 +107,6 @@ add_task(async function setup() {
|
|||
// Ignore error messages for no profile found in old XULStore.jsm
|
||||
return;
|
||||
}
|
||||
if (msg.errorMessage.includes("Error reading typed URL history")) {
|
||||
// The Migrator when opened can log this exception if there is no Edge
|
||||
// history on the machine.
|
||||
return;
|
||||
}
|
||||
if (msg.errorMessage.includes(EXPECTED_ERROR_MESSAGE)) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -70,7 +70,6 @@ login-intro-description = If you saved your logins to { -brand-product-name } on
|
|||
login-intro-instruction-fxa = Create or sign in to your { -fxaccount-brand-name } on the device where your logins are saved
|
||||
login-intro-instruction-fxa-settings = Make sure you’ve selected the Logins checkbox in { -sync-brand-short-name } Settings
|
||||
about-logins-intro-instruction-help = Visit <a data-l10n-name="help-link">{ -lockwise-brand-short-name } Support</a> for more help
|
||||
about-logins-intro-import = If your logins are saved in another browser, you can <a data-l10n-name="import-link">import them into { -lockwise-brand-short-name }</a>
|
||||
|
||||
## Login
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче