Bug 1438702 - Skip test_credit_card_autofill_section when CC autofill is disabled. r=jaws
MozReview-Commit-ID: B1qa9BhIa05
--- a/browser/components/preferences/in-content/tests/browser.ini
+++ b/browser/components/preferences/in-content/tests/browser.ini
@@ -1,9 +1,12 @@
[DEFAULT]
+prefs =
+ extensions.formautofill.available='on'
+ extensions.formautofill.creditCards.available=true
support-files =
head.js
privacypane_tests_perwindow.js
site_data_test.html
service_worker_test.html
service_worker_test.js
addons/set_homepage.xpi
addons/set_newtab.xpi
--- a/browser/components/preferences/in-content/tests/browser_spotlight.js
+++ b/browser/components/preferences/in-content/tests/browser_spotlight.js
@@ -20,16 +20,19 @@ add_task(async function test_address_aut
await TestUtils.waitForCondition(() => doc.querySelector(".spotlight"),
"Wait for the ddress-autofill section is spotlighted.");
is(doc.querySelector(".spotlight").getAttribute("data-subcategory"), "address-autofill",
"The ddress-autofill section is spotlighted.");
await BrowserTestUtils.removeTab(gBrowser.selectedTab);
});
add_task(async function test_credit_card_autofill_section() {
+ if (!Services.prefs.getBoolPref("extensions.formautofill.creditCards.available")) {
+ return;
+ }
let prefs = await openPreferencesViaOpenPreferencesAPI("privacy-credit-card-autofill", {leaveOpen: true});
is(prefs.selectedPane, "panePrivacy", "Privacy pane is selected by default");
let doc = gBrowser.contentDocument;
is(doc.location.hash, "#privacy", "The subcategory should be removed from the URI");
await TestUtils.waitForCondition(() => doc.querySelector(".spotlight"),
"Wait for the credit-card-autofill section is spotlighted.");
is(doc.querySelector(".spotlight").getAttribute("data-subcategory"), "credit-card-autofill",
"The credit-card-autofill section is spotlighted.");