зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1691821 - [3.2] Adjust form autofill extension tests to work with the shared component. r=zbraniecki,dimi,jmaher
Differential Revision: https://phabricator.services.mozilla.com/D110273
This commit is contained in:
Родитель
ea394ebcbc
Коммит
a35b4fa14b
|
@ -36,9 +36,9 @@ var gExceptionPaths = [
|
|||
// toolkit/components/pdfjs/content/build/pdf.js
|
||||
"resource://pdf.js/web/images/",
|
||||
|
||||
// Exclude all the metadata paths under the country metadata folder because these
|
||||
// paths will be concatenated in FormAutofillUtils.jsm based on different country/region.
|
||||
"resource://formautofill/addressmetadata/",
|
||||
// Exclude the form autofill path that has been moved out of the extensions to
|
||||
// toolkit, see bug 1691821.
|
||||
"resource://gre-resources/autofill/",
|
||||
|
||||
// Exclude all search-extensions because they aren't referenced by filename
|
||||
"resource://search-extensions/",
|
||||
|
@ -372,7 +372,7 @@ function trackChromeUri(uri) {
|
|||
// formautofill registers resource://formautofill/ and
|
||||
// chrome://formautofill/content/ dynamically at runtime.
|
||||
// Bug 1480276 is about addressing this without this hard-coding.
|
||||
trackResourcePrefix("formautofill");
|
||||
trackResourcePrefix("autofill");
|
||||
trackChromeUri("chrome://formautofill/content/");
|
||||
|
||||
function parseManifest(manifestUri) {
|
||||
|
|
|
@ -142,8 +142,7 @@ async function initProfileStorage(
|
|||
collectionName = "addresses"
|
||||
) {
|
||||
let { FormAutofillStorage } = ChromeUtils.import(
|
||||
"resource://autofill/FormAutofillStorage.jsm",
|
||||
null
|
||||
"resource://autofill/FormAutofillStorage.jsm"
|
||||
);
|
||||
let path = getTempFile(fileName).path;
|
||||
let profileStorage = new FormAutofillStorage(path);
|
||||
|
|
|
@ -27,6 +27,7 @@ add_task(async function test_activeStatus_init() {
|
|||
|
||||
// Initialize profile storage
|
||||
await FormAutofillStatus.formAutofillStorage.initialize();
|
||||
await FormAutofillStatus.updateSavedFieldNames();
|
||||
// Upon first initializing profile storage, status should be computed.
|
||||
Assert.equal(FormAutofillStatus.updateStatus.called, true);
|
||||
Assert.equal(Services.ppmm.sharedData.get("FormAutofill:enabled"), false);
|
||||
|
@ -107,14 +108,14 @@ add_task(async function test_activeStatus_computeStatus() {
|
|||
"getSavedFieldNames"
|
||||
);
|
||||
FormAutofillStatus.formAutofillStorage.addresses.getSavedFieldNames.returns(
|
||||
new Set()
|
||||
Promise.resolve(new Set())
|
||||
);
|
||||
sinon.stub(
|
||||
FormAutofillStatus.formAutofillStorage.creditCards,
|
||||
"getSavedFieldNames"
|
||||
);
|
||||
FormAutofillStatus.formAutofillStorage.creditCards.getSavedFieldNames.returns(
|
||||
new Set()
|
||||
Promise.resolve(new Set())
|
||||
);
|
||||
|
||||
// pref is enabled and profile is empty.
|
||||
|
@ -137,9 +138,9 @@ add_task(async function test_activeStatus_computeStatus() {
|
|||
Assert.equal(FormAutofillStatus.computeStatus(), false);
|
||||
|
||||
FormAutofillStatus.formAutofillStorage.addresses.getSavedFieldNames.returns(
|
||||
new Set(["given-name"])
|
||||
Promise.resolve(new Set(["given-name"]))
|
||||
);
|
||||
FormAutofillStatus.observe(null, "formautofill-storage-changed", "add");
|
||||
await FormAutofillStatus.observe(null, "formautofill-storage-changed", "add");
|
||||
|
||||
// pref is enabled and profile is not empty.
|
||||
Services.prefs.setBoolPref("extensions.formautofill.addresses.enabled", true);
|
||||
|
|
|
@ -16,8 +16,7 @@ const { CreditCard } = ChromeUtils.import(
|
|||
let FormAutofillStorage;
|
||||
add_task(async function setup() {
|
||||
({ FormAutofillStorage } = ChromeUtils.import(
|
||||
"resource://autofill/FormAutofillStorage.jsm",
|
||||
null
|
||||
"resource://autofill/FormAutofillStorage.jsm"
|
||||
));
|
||||
});
|
||||
|
||||
|
|
|
@ -7,8 +7,7 @@
|
|||
let FormAutofillStorage;
|
||||
add_task(async function setup() {
|
||||
({ FormAutofillStorage } = ChromeUtils.import(
|
||||
"resource://autofill/FormAutofillStorage.jsm",
|
||||
null
|
||||
"resource://autofill/FormAutofillStorage.jsm"
|
||||
));
|
||||
});
|
||||
|
||||
|
|
|
@ -7,8 +7,7 @@
|
|||
let FormAutofillStorage;
|
||||
add_task(async function setup() {
|
||||
({ FormAutofillStorage } = ChromeUtils.import(
|
||||
"resource://autofill/FormAutofillStorage.jsm",
|
||||
null
|
||||
"resource://autofill/FormAutofillStorage.jsm"
|
||||
));
|
||||
});
|
||||
|
||||
|
|
|
@ -7,8 +7,7 @@
|
|||
let FormAutofillStorage;
|
||||
add_task(async function setup() {
|
||||
({ FormAutofillStorage } = ChromeUtils.import(
|
||||
"resource://autofill/FormAutofillStorage.jsm",
|
||||
null
|
||||
"resource://autofill/FormAutofillStorage.jsm"
|
||||
));
|
||||
});
|
||||
|
||||
|
|
|
@ -7,8 +7,7 @@
|
|||
let FormAutofillStorage;
|
||||
add_task(async function setup() {
|
||||
({ FormAutofillStorage } = ChromeUtils.import(
|
||||
"resource://autofill/FormAutofillStorage.jsm",
|
||||
null
|
||||
"resource://autofill/FormAutofillStorage.jsm"
|
||||
));
|
||||
});
|
||||
|
||||
|
|
|
@ -217,7 +217,7 @@ let FormAutofillStatus = {
|
|||
|
||||
onCloseWindow() {},
|
||||
|
||||
observe(subject, topic, data) {
|
||||
async observe(subject, topic, data) {
|
||||
log.debug("observe:", topic, "with data:", data);
|
||||
switch (topic) {
|
||||
case "privacy-pane-loaded": {
|
||||
|
@ -243,7 +243,7 @@ let FormAutofillStatus = {
|
|||
break;
|
||||
}
|
||||
|
||||
this.updateSavedFieldNames();
|
||||
await this.updateSavedFieldNames();
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче