Bug 1567175, rename LoginManagerContent to LoginManagerChild, r=MattN

Differential Revision: https://phabricator.services.mozilla.com/D47824

--HG--
rename : toolkit/components/passwordmgr/LoginManagerContent.jsm => toolkit/components/passwordmgr/LoginManagerChild.jsm
extra : moz-landing-system : lando
This commit is contained in:
Neil Deakin 2019-10-21 18:17:50 +00:00
Родитель 3302428083
Коммит 7cbc074da1
21 изменённых файлов: 84 добавлений и 87 удалений

Просмотреть файл

@ -20,7 +20,7 @@ XPCOMUtils.defineLazyModuleGetters(this, {
BrowserUtils: "resource://gre/modules/BrowserUtils.jsm",
findAllCssSelectors: "resource://gre/modules/css-selector.js",
SpellCheckHelper: "resource://gre/modules/InlineSpellChecker.jsm",
LoginManagerContent: "resource://gre/modules/LoginManagerContent.jsm",
LoginManagerChild: "resource://gre/modules/LoginManagerChild.jsm",
WebNavigationFrames: "resource://gre/modules/WebNavigationFrames.jsm",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
InlineSpellCheckerContent:
@ -561,7 +561,7 @@ class ContextMenuChild extends JSWindowActorChild {
} = doc;
docLocation = docLocation && docLocation.spec;
let frameOuterWindowID = WebNavigationFrames.getFrameId(doc.defaultView);
let loginFillInfo = LoginManagerContent.forWindow(
let loginFillInfo = LoginManagerChild.forWindow(
doc.defaultView
).getFieldContext(aEvent.composedTarget);

Просмотреть файл

@ -16,18 +16,18 @@ var { XPCOMUtils } = ChromeUtils.import(
XPCOMUtils.defineLazyModuleGetters(this, {
ContentMetaHandler: "resource:///modules/ContentMetaHandler.jsm",
LoginFormFactory: "resource://gre/modules/LoginFormFactory.jsm",
LoginManagerContent: "resource://gre/modules/LoginManagerContent.jsm",
LoginManagerChild: "resource://gre/modules/LoginManagerChild.jsm",
InsecurePasswordUtils: "resource://gre/modules/InsecurePasswordUtils.jsm",
});
// NOTE: Much of this logic is duplicated in BrowserCLH.js for Android.
addMessageListener("PasswordManager:fillForm", function(message) {
// intercept if ContextMenu.jsm had sent a plain object for remote targets
LoginManagerContent.receiveMessage(message, content);
LoginManagerChild.receiveMessage(message, content);
});
addMessageListener("PasswordManager:fillGeneratedPassword", function(message) {
// forward message to LMC
LoginManagerContent.receiveMessage(message, content);
LoginManagerChild.receiveMessage(message, content);
});
function shouldIgnoreLoginManagerEvent(event) {
@ -45,13 +45,13 @@ addEventListener("DOMFormBeforeSubmit", function(event) {
if (shouldIgnoreLoginManagerEvent(event)) {
return;
}
this.LoginManagerContent.forWindow(content).onDOMFormBeforeSubmit(event);
this.LoginManagerChild.forWindow(content).onDOMFormBeforeSubmit(event);
});
addEventListener("DOMFormHasPassword", function(event) {
if (shouldIgnoreLoginManagerEvent(event)) {
return;
}
this.LoginManagerContent.forWindow(content).onDOMFormHasPassword(event);
this.LoginManagerChild.forWindow(content).onDOMFormHasPassword(event);
let formLike = LoginFormFactory.createFromForm(event.originalTarget);
InsecurePasswordUtils.reportInsecurePasswords(formLike);
});
@ -59,7 +59,7 @@ addEventListener("DOMInputPasswordAdded", function(event) {
if (shouldIgnoreLoginManagerEvent(event)) {
return;
}
this.LoginManagerContent.forWindow(content).onDOMInputPasswordAdded(
this.LoginManagerChild.forWindow(content).onDOMInputPasswordAdded(
event,
content
);

Просмотреть файл

@ -25,8 +25,8 @@ ChromeUtils.defineModuleGetter(
);
ChromeUtils.defineModuleGetter(
this,
"LoginManagerContent",
"resource://gre/modules/LoginManagerContent.jsm"
"LoginManagerChild",
"resource://gre/modules/LoginManagerChild.jsm"
);
XPCOMUtils.defineLazyGetter(this, "gPipNSSBundle", function() {
@ -640,7 +640,7 @@ var AboutReaderListener = {
AboutReaderListener.init();
addMessageListener("PasswordManager:fillForm", function(message) {
LoginManagerContent.receiveMessage(message, content);
LoginManagerChild.receiveMessage(message, content);
});
Services.obs.notifyObservers(this, "tab-content-frameloader-created");

Просмотреть файл

@ -87,8 +87,8 @@ BrowserCLH.prototype = {
// BrowserGlue.jsm
],
});
GeckoViewUtils.addLazyGetter(this, "LoginManagerContent", {
module: "resource://gre/modules/LoginManagerContent.jsm",
GeckoViewUtils.addLazyGetter(this, "LoginManagerChild", {
module: "resource://gre/modules/LoginManagerChild.jsm",
});
GeckoViewUtils.addLazyGetter(this, "ActionBarHandler", {
@ -228,7 +228,7 @@ BrowserCLH.prototype = {
if (shouldIgnoreLoginManagerEvent(event)) {
return;
}
this.LoginManagerContent.forWindow(aWindow).onDOMFormBeforeSubmit(event);
this.LoginManagerChild.forWindow(aWindow).onDOMFormBeforeSubmit(event);
});
aWindow.addEventListener(
"DOMFormHasPassword",
@ -236,7 +236,7 @@ BrowserCLH.prototype = {
if (shouldIgnoreLoginManagerEvent(event)) {
return;
}
this.LoginManagerContent.forWindow(aWindow).onDOMFormHasPassword(event);
this.LoginManagerChild.forWindow(aWindow).onDOMFormHasPassword(event);
},
options
);
@ -247,7 +247,7 @@ BrowserCLH.prototype = {
if (shouldIgnoreLoginManagerEvent(event)) {
return;
}
this.LoginManagerContent.forWindow(aWindow).onDOMInputPasswordAdded(
this.LoginManagerChild.forWindow(aWindow).onDOMInputPasswordAdded(
event,
event.target.ownerGlobal.top
);
@ -260,7 +260,7 @@ BrowserCLH.prototype = {
event => {
// XXXbz what about non-HTML documents??
if (ChromeUtils.getClassName(event.target) == "HTMLDocument") {
this.LoginManagerContent.forWindow(aWindow).onPageShow(event);
this.LoginManagerChild.forWindow(aWindow).onPageShow(event);
}
},
options

Просмотреть файл

@ -16,7 +16,7 @@ const { GeckoViewUtils } = ChromeUtils.import(
XPCOMUtils.defineLazyModuleGetters(this, {
DeferredTask: "resource://gre/modules/DeferredTask.jsm",
FormLikeFactory: "resource://gre/modules/FormLikeFactory.jsm",
LoginManagerContent: "resource://gre/modules/LoginManagerContent.jsm",
LoginManagerChild: "resource://gre/modules/LoginManagerChild.jsm",
});
const { debug, warn } = GeckoViewUtils.initLogging("Autofill"); // eslint-disable-line no-unused-vars
@ -140,7 +140,7 @@ class GeckoViewAutofill {
return info;
};
// Get password field to get better form data via LoginManagerContent.
// Get password field to get better form data via LoginManagerChild.
let passwordField;
for (const field of aFormLike.elements) {
if (
@ -152,7 +152,7 @@ class GeckoViewAutofill {
}
}
const [usernameField] = LoginManagerContent.forWindow(
const [usernameField] = LoginManagerChild.forWindow(
window
).getUserNameAndPasswordFields(passwordField || aFormLike.elements[0]);

Просмотреть файл

@ -37,8 +37,8 @@ ChromeUtils.defineModuleGetter(
);
ChromeUtils.defineModuleGetter(
this,
"LoginManagerContent",
"resource://gre/modules/LoginManagerContent.jsm"
"LoginManagerChild",
"resource://gre/modules/LoginManagerChild.jsm"
);
XPCOMUtils.defineLazyServiceGetter(
@ -426,7 +426,7 @@ LoginAutoComplete.prototype = {
// want the same treatment:
// * The web console warnings will be confusing (as they're primarily about http:) and not very
// useful if the developer intentionally sandboxed the document.
// * The site identity insecure field warning would require LoginManagerContent being loaded and
// * The site identity insecure field warning would require LoginManagerChild being loaded and
// listening to some of the DOM events we're ignoring in null principal documents. For memory
// reasons it's better to not load LMC at all for these sandboxed frames. Also, if the top-
// document is sandboxing a document, it probably doesn't want that sandboxed document to be
@ -505,7 +505,7 @@ LoginAutoComplete.prototype = {
previousResult = null;
}
let loginManager = LoginManagerContent.forWindow(aElement.ownerGlobal);
let loginManager = LoginManagerChild.forWindow(aElement.ownerGlobal);
let acLookupPromise = (this._autoCompleteLookupPromise = loginManager._autoCompleteSearchAsync(
aSearchString,
previousResult,

Просмотреть файл

@ -24,8 +24,8 @@ ChromeUtils.defineModuleGetter(
);
ChromeUtils.defineModuleGetter(
this,
"LoginManagerContent",
"resource://gre/modules/LoginManagerContent.jsm"
"LoginManagerChild",
"resource://gre/modules/LoginManagerChild.jsm"
);
ChromeUtils.defineModuleGetter(
this,

Просмотреть файл

@ -11,7 +11,7 @@
"use strict";
const EXPORTED_SYMBOLS = ["LoginManagerContent"];
const EXPORTED_SYMBOLS = ["LoginManagerChild"];
const PASSWORD_INPUT_ADDED_COALESCING_THRESHOLD_MS = 1;
const AUTOCOMPLETE_AFTER_RIGHT_CLICK_THRESHOLD_MS = 400;
@ -80,7 +80,7 @@ XPCOMUtils.defineLazyServiceGetter(
);
XPCOMUtils.defineLazyGetter(this, "log", () => {
let logger = LoginHelper.createLogger("LoginManagerContent");
let logger = LoginHelper.createLogger("LoginManagerChild");
return logger.log.bind(logger);
});
@ -88,7 +88,7 @@ Services.cpmm.addMessageListener("clearRecipeCache", () => {
LoginRecipesContent._clearRecipeCache();
});
let gLoginManagerContentSingleton = null;
let gLoginManagerChildSingleton = null;
let _messages = [
"PasswordManager:loginsFound",
@ -120,7 +120,7 @@ const observer = {
aWebProgress.DOMWindow.document
);
LoginManagerContent.forWindow(aWebProgress.DOMWindow)._onNavigation(
LoginManagerChild.forWindow(aWebProgress.DOMWindow)._onNavigation(
aWebProgress.DOMWindow.document
);
},
@ -132,7 +132,7 @@ const observer = {
) {
// Re-fill a document restored from bfcache since password field values
// aren't persisted there.
LoginManagerContent.forWindow(aWebProgress.DOMWindow)._onDocumentRestored(
LoginManagerChild.forWindow(aWebProgress.DOMWindow)._onDocumentRestored(
aWebProgress.DOMWindow.document
);
return;
@ -167,7 +167,7 @@ const observer = {
}
log("onStateChange handled:", channel);
LoginManagerContent.forWindow(aWebProgress.DOMWindow)._onNavigation(
LoginManagerChild.forWindow(aWebProgress.DOMWindow)._onNavigation(
aWebProgress.DOMWindow.document
);
},
@ -190,17 +190,17 @@ const observer = {
}
let window = focusedInput.ownerGlobal;
let loginManagerContent = LoginManagerContent.forWindow(window);
let loginManagerChild = LoginManagerChild.forWindow(window);
let style = input.controller.getStyleAt(selectedIndex);
if (style == "login" || style == "loginWithOrigin") {
let details = JSON.parse(
input.controller.getCommentAt(selectedIndex)
);
loginManagerContent.onFieldAutoComplete(focusedInput, details.guid);
loginManagerChild.onFieldAutoComplete(focusedInput, details.guid);
} else if (style == "generatedPassword") {
loginManagerContent._highlightFilledField(focusedInput);
loginManagerContent._generatedPasswordFilledOrEdited(focusedInput);
loginManagerChild._highlightFilledField(focusedInput);
loginManagerChild._generatedPasswordFilledOrEdited(focusedInput);
}
break;
}
@ -223,7 +223,7 @@ const observer = {
// Used to mask fields with filled generated passwords when blurred.
case "blur": {
let unmask = false;
LoginManagerContent.forWindow(window)._togglePasswordFieldMasking(
LoginManagerChild.forWindow(window)._togglePasswordFieldMasking(
aEvent.target,
unmask
);
@ -232,7 +232,7 @@ const observer = {
// Used to watch for changes to fields filled with generated passwords.
case "change": {
LoginManagerContent.forWindow(window)._generatedPasswordFilledOrEdited(
LoginManagerChild.forWindow(window)._generatedPasswordFilledOrEdited(
aEvent.target
);
break;
@ -240,7 +240,7 @@ const observer = {
// Used to watch for changes to fields filled with generated passwords.
case "input": {
LoginManagerContent.forWindow(
LoginManagerChild.forWindow(
window
)._maybeStopTreatingAsGeneratedPasswordField(aEvent);
break;
@ -251,7 +251,7 @@ const observer = {
aEvent.keyCode == aEvent.DOM_VK_TAB ||
aEvent.keyCode == aEvent.DOM_VK_RETURN
) {
LoginManagerContent.forWindow(window).onUsernameAutocompleted(
LoginManagerChild.forWindow(window).onUsernameAutocompleted(
aEvent.target
);
}
@ -262,7 +262,7 @@ const observer = {
if (aEvent.target.type == "password") {
// Used to unmask fields with filled generated passwords when focused.
let unmask = true;
LoginManagerContent.forWindow(window)._togglePasswordFieldMasking(
LoginManagerChild.forWindow(window)._togglePasswordFieldMasking(
aEvent.target,
unmask
);
@ -270,7 +270,7 @@ const observer = {
}
// Only used for username fields.
LoginManagerContent.forWindow(window)._onUsernameFocus(aEvent);
LoginManagerChild.forWindow(window)._onUsernameFocus(aEvent);
break;
}
@ -364,7 +364,7 @@ let gAutoCompleteListener = {
},
};
this.LoginManagerContent = class LoginManagerContent {
this.LoginManagerChild = class LoginManagerChild {
constructor() {
/**
* WeakMap of the root element of a LoginForm to the DeferredTask to fill its fields.
@ -403,11 +403,10 @@ this.LoginManagerContent = class LoginManagerContent {
static forWindow(window) {
// For now, this is a singleton.
if (!gLoginManagerContentSingleton) {
gLoginManagerContentSingleton = new LoginManagerContent();
if (!gLoginManagerChildSingleton) {
gLoginManagerChildSingleton = new LoginManagerChild();
}
return gLoginManagerContentSingleton;
return gLoginManagerChildSingleton;
}
_getRandomId() {

Просмотреть файл

@ -240,7 +240,7 @@ class LoginManagerParent {
/**
* Trigger a login form fill and send relevant data (e.g. logins and recipes)
* to the child process (LoginManagerContent).
* to the child process (LoginManagerChild).
*/
async fillForm({ browser, loginFormOrigin, login, inputElementIdentifier }) {
let recipes = [];
@ -268,7 +268,7 @@ class LoginManagerParent {
}
/**
* Send relevant data (e.g. logins and recipes) to the child process (LoginManagerContent).
* Send relevant data (e.g. logins and recipes) to the child process (LoginManagerChild).
*/
async sendLoginDataToChild(
formOrigin,
@ -401,7 +401,7 @@ class LoginManagerParent {
timeDiff / 1000
)} seconds ago.`
);
// Send an empty array to make LoginManagerContent clear the
// Send an empty array to make LoginManagerChild clear the
// outstanding request it has temporarily saved.
target.messageManager.sendAsyncMessage(
"PasswordManager:loginsAutoCompleted",

Просмотреть файл

@ -37,7 +37,7 @@ EXTRA_JS_MODULES += [
'LoginHelper.jsm',
'LoginInfo.jsm',
'LoginManager.jsm',
'LoginManagerContent.jsm',
'LoginManagerChild.jsm',
'LoginManagerParent.jsm',
'LoginManagerPrompter.jsm',
'LoginRecipes.jsm',

Просмотреть файл

@ -64,8 +64,8 @@ add_task(async function test() {
const { LoginFormFactory } = ChromeUtils.import(
"resource://gre/modules/LoginFormFactory.jsm"
);
const { LoginManagerContent } = ChromeUtils.import(
"resource://gre/modules/LoginManagerContent.jsm"
const { LoginManagerChild } = ChromeUtils.import(
"resource://gre/modules/LoginManagerChild.jsm"
);
const { LoginHelper } = ChromeUtils.import(
"resource://gre/modules/LoginHelper.jsm"
@ -75,7 +75,7 @@ add_task(async function test() {
let formLike = LoginFormFactory.createFromField(password);
info("Calling _fillForm with FormLike");
addedLogin = LoginHelper.vanillaObjectToLogin(addedLogin);
LoginManagerContent.forWindow(content)._fillForm(
LoginManagerChild.forWindow(content)._fillForm(
formLike,
[addedLogin],
null,

Просмотреть файл

@ -41,7 +41,7 @@ function preventDefaultAndStopProgagation(event) {
<div id="content" style="display: none"></div>
<pre id="test"></pre>
<script>
const { LoginManagerContent } = SpecialPowers.Cu.import("resource://gre/modules/LoginManagerContent.jsm", {});
const { LoginManagerChild } = SpecialPowers.Cu.import("resource://gre/modules/LoginManagerChild.jsm", {});
add_task(async function setup() {
await SpecialPowers.pushPrefEnv({"set": [
@ -62,7 +62,7 @@ add_task(async function test_preventDefaultAndStopPropagation() {
SpecialPowers.wrap(pword).setUserInput("generatedpass");
LOGIN_FIELD_UTILS.checkPasswordMasked(pword, true, "Before first fill");
LoginManagerContent.forWindow(window)._generatedPasswordFilledOrEdited(pword);
LoginManagerChild.forWindow(window)._generatedPasswordFilledOrEdited(pword);
LOGIN_FIELD_UTILS.checkPasswordMasked(pword, false, "After first fill");
synthesizeKey("KEY_Tab"); // blur
LOGIN_FIELD_UTILS.checkPasswordMasked(pword, true, "After blur");
@ -80,7 +80,7 @@ add_task(async function test_fieldsMaskedAfterSavedLoginFill() {
SpecialPowers.wrap(pword).setUserInput("generatedpass");
LOGIN_FIELD_UTILS.checkPasswordMasked(pword, true, "Before first fill");
LoginManagerContent.forWindow(window)._generatedPasswordFilledOrEdited(pword);
LoginManagerChild.forWindow(window)._generatedPasswordFilledOrEdited(pword);
LOGIN_FIELD_UTILS.checkPasswordMasked(pword, false, "After first fill");
synthesizeKey("KEY_Tab", { shiftKey: true }); // blur pw, focus un
LOGIN_FIELD_UTILS.checkPasswordMasked(pword, true, "After blur");
@ -105,7 +105,7 @@ add_task(async function test_fieldsMaskedAfterReplacingWholeValue() {
SpecialPowers.wrap(pword).setUserInput("generatedpass");
LOGIN_FIELD_UTILS.checkPasswordMasked(pword, true, "Before first fill");
LoginManagerContent.forWindow(window)._generatedPasswordFilledOrEdited(pword);
LoginManagerChild.forWindow(window)._generatedPasswordFilledOrEdited(pword);
LOGIN_FIELD_UTILS.checkPasswordMasked(pword, false, "After first fill");
synthesizeKey("KEY_Tab", { shiftKey: true }); // blur pw, focus un
LOGIN_FIELD_UTILS.checkPasswordMasked(pword, true, "After blur");
@ -132,7 +132,7 @@ add_task(async function test_fieldsUnmaskedAfterAddingCharacter() {
SpecialPowers.wrap(pword).setUserInput("generatedpass");
LOGIN_FIELD_UTILS.checkPasswordMasked(pword, true, "Before first fill");
LoginManagerContent.forWindow(window)._generatedPasswordFilledOrEdited(pword);
LoginManagerChild.forWindow(window)._generatedPasswordFilledOrEdited(pword);
LOGIN_FIELD_UTILS.checkPasswordMasked(pword, false, "After first fill");
synthesizeKey("KEY_Tab", { shiftKey: true }); // blur pw, focus un
LOGIN_FIELD_UTILS.checkPasswordMasked(pword, true, "After blur");
@ -160,7 +160,7 @@ add_task(async function test_typeNotPassword() {
LOGIN_FIELD_UTILS.checkPasswordMasked(pword, true, "Before first fill");
SpecialPowers.wrap(pword).setUserInput("generatedpass");
LoginManagerContent.forWindow(window)._generatedPasswordFilledOrEdited(pword);
LoginManagerChild.forWindow(window)._generatedPasswordFilledOrEdited(pword);
LOGIN_FIELD_UTILS.checkPasswordMasked(pword, false, "After first fill");
// Simulate a website doing their own unmasking and re-masking

Просмотреть файл

@ -10,8 +10,8 @@
<body>
<script type="application/javascript">
const {LoginFormFactory} = SpecialPowers.Cu.import("resource://gre/modules/LoginFormFactory.jsm");
const LMCBackstagePass = SpecialPowers.Cu.import("resource://gre/modules/LoginManagerContent.jsm");
const { LoginManagerContent } = LMCBackstagePass;
const LMCBackstagePass = SpecialPowers.Cu.import("resource://gre/modules/LoginManagerChild.jsm");
const { LoginManagerChild } = LMCBackstagePass;
function loadFrame() {
return new Promise(resolve => {
@ -156,7 +156,7 @@ add_task(async function test() {
info("Calling _onFormSubmit with FormLike");
let processedPromise = getSubmitMessage();
LoginManagerContent.forWindow(frameDoc.defaultView)._onFormSubmit(formLike);
LoginManagerChild.forWindow(frameDoc.defaultView)._onFormSubmit(formLike);
let submittedResult = await processedPromise;

Просмотреть файл

@ -9,8 +9,8 @@
</head>
<body>
<script type="application/javascript">
const LMCBackstagePass = SpecialPowers.Cu.import("resource://gre/modules/LoginManagerContent.jsm");
const { LoginManagerContent } = LMCBackstagePass;
const LMCBackstagePass = SpecialPowers.Cu.import("resource://gre/modules/LoginManagerChild.jsm");
const { LoginManagerChild } = LMCBackstagePass;
let loadPromise = new Promise(resolve => {
document.addEventListener("DOMContentLoaded", () => {

Просмотреть файл

@ -9,8 +9,8 @@
</head>
<body>
<script type="application/javascript">
const LMCBackstagePass = SpecialPowers.Cu.import("resource://gre/modules/LoginManagerContent.jsm");
const { LoginManagerContent } = LMCBackstagePass;
const LMCBackstagePass = SpecialPowers.Cu.import("resource://gre/modules/LoginManagerChild.jsm");
const { LoginManagerChild } = LMCBackstagePass;
SimpleTest.requestFlakyTimeout("Testing that a message doesn't arrive");

Просмотреть файл

@ -10,8 +10,8 @@
</head>
<body>
<script type="application/javascript">
const LMCBackstagePass = SpecialPowers.Cu.import("resource://gre/modules/LoginManagerContent.jsm");
const { LoginManagerContent } = LMCBackstagePass;
const LMCBackstagePass = SpecialPowers.Cu.import("resource://gre/modules/LoginManagerChild.jsm");
const { LoginManagerChild } = LMCBackstagePass;
let readyPromise = registerRunTests();

Просмотреть файл

@ -9,8 +9,8 @@
</head>
<body>
<script type="application/javascript">
const LMCBackstagePass = SpecialPowers.Cu.import("resource://gre/modules/LoginManagerContent.jsm");
const { LoginManagerContent } = LMCBackstagePass;
const LMCBackstagePass = SpecialPowers.Cu.import("resource://gre/modules/LoginManagerChild.jsm");
const { LoginManagerChild } = LMCBackstagePass;
let readyPromise = registerRunTests();

Просмотреть файл

@ -1,5 +1,5 @@
/**
* Test for LoginManagerContent._getFormFields.
* Test for LoginManagerChild._getFormFields.
*/
"use strict";
@ -10,10 +10,10 @@ const { LoginFormFactory } = ChromeUtils.import(
"resource://gre/modules/LoginFormFactory.jsm"
);
const LMCBackstagePass = ChromeUtils.import(
"resource://gre/modules/LoginManagerContent.jsm",
"resource://gre/modules/LoginManagerChild.jsm",
null
);
const { LoginManagerContent } = LMCBackstagePass;
const { LoginManagerChild } = LMCBackstagePass;
const TESTCASES = [
{
description: "1 password field outside of a <form>",
@ -161,7 +161,7 @@ for (let tc of TESTCASES) {
await testcase.beforeGetFunction(document, formLike);
}
let actual = new LoginManagerContent()._getFormFields(
let actual = new LoginManagerChild()._getFormFields(
formLike,
testcase.skipEmptyFields,
new Set()

Просмотреть файл

@ -1,5 +1,5 @@
/**
* Test for LoginManagerContent._getPasswordFields using LoginFormFactory.
* Test for LoginManagerChild._getPasswordFields using LoginFormFactory.
*/
/* globals todo_check_eq */
@ -9,10 +9,10 @@ const { LoginFormFactory } = ChromeUtils.import(
"resource://gre/modules/LoginFormFactory.jsm"
);
const LMCBackstagePass = ChromeUtils.import(
"resource://gre/modules/LoginManagerContent.jsm",
"resource://gre/modules/LoginManagerChild.jsm",
null
);
const { LoginManagerContent } = LMCBackstagePass;
const { LoginManagerChild } = LMCBackstagePass;
const TESTCASES = [
{
description: "Empty document",
@ -197,7 +197,7 @@ for (let tc of TESTCASES) {
let formLikeIndex = -1;
for (let formLikeFromInput of mapRootElementToFormLike.values()) {
formLikeIndex++;
let pwFields = new LoginManagerContent()._getPasswordFields(
let pwFields = new LoginManagerChild()._getPasswordFields(
formLikeFromInput,
{
fieldOverrideRecipe: testcase.fieldOverrideRecipe,
@ -287,7 +287,7 @@ for (let tc of EMOJI_TESTCASES) {
let input = document.querySelector("input[type='password']");
Assert.ok(input, "Found the password field");
let formLike = LoginFormFactory.createFromField(input);
let pwFields = new LoginManagerContent()._getPasswordFields(formLike, {
let pwFields = new LoginManagerChild()._getPasswordFields(formLike, {
minPasswordLength: testcase.minPasswordLength,
});
info("Got password fields: " + pwFields.length);

Просмотреть файл

@ -1,5 +1,5 @@
/**
* Test for LoginManagerContent.getUserNameAndPasswordFields
* Test for LoginManagerChild.getUserNameAndPasswordFields
*/
"use strict";
@ -7,10 +7,10 @@
XPCOMUtils.defineLazyGlobalGetters(this, ["URL"]);
const LMCBackstagePass = ChromeUtils.import(
"resource://gre/modules/LoginManagerContent.jsm",
"resource://gre/modules/LoginManagerChild.jsm",
null
);
const { LoginManagerContent } = LMCBackstagePass;
const { LoginManagerChild } = LMCBackstagePass;
const TESTCASES = [
{
description: "1 password field outside of a <form>",
@ -111,9 +111,7 @@ for (let tc of TESTCASES) {
let formOrigin = LoginHelper.getLoginOrigin(document.documentURI);
LoginRecipesContent.cacheRecipes(formOrigin, win, new Set());
let actual = new LoginManagerContent().getUserNameAndPasswordFields(
input
);
let actual = new LoginManagerChild().getUserNameAndPasswordFields(input);
Assert.strictEqual(
testcase.returnedFieldIDs.length,

Просмотреть файл

@ -87,7 +87,7 @@ nsFormFillController::nsFormFillController()
mListNode(nullptr),
// The amount of time a context menu event supresses showing a
// popup from a focus event in ms. This matches the threshold in
// toolkit/components/passwordmgr/LoginManagerContent.jsm.
// toolkit/components/passwordmgr/LoginManagerChild.jsm.
mFocusAfterRightClickThreshold(400),
mTimeout(50),
mMinResultsForPopup(1),