Bug 1875090 - Rename BrowserTestUtils.is_hidden() to isHidden() r=Gijs,settings-reviewers,pip-reviewers,credential-management-reviewers,devtools-reviewers,fxview-reviewers,translations-reviewers,sgalich,mhowell

Renames all instances of the snake_case identifier to
camelCase to match more closely to idiomatic JavaScript
and to existing conventions throughout the code base.

Differential Revision: https://phabricator.services.mozilla.com/D198825
This commit is contained in:
Erik Nordin
2024-01-19 02:15:33 +00:00
parent 3c2b4d4a8c
commit 857bffe429
77 changed files with 164 additions and 173 deletions

View File

@@ -101,7 +101,7 @@ add_task(async function () {
// Test the dialog window opens
ok(
BrowserTestUtils.is_hidden(dialogOverlay),
BrowserTestUtils.isHidden(dialogOverlay),
"The dialog should be invisible"
);
let promiseSubDialogLoaded = promiseLoadSubDialog(
@@ -109,10 +109,7 @@ add_task(async function () {
);
showBtn.doCommand();
await promiseSubDialogLoaded;
ok(
!BrowserTestUtils.is_hidden(dialogOverlay),
"The dialog should be visible"
);
ok(!BrowserTestUtils.isHidden(dialogOverlay), "The dialog should be visible");
let dialogFrame = dialogOverlay.querySelector(".dialogFrame");
let frameDoc = dialogFrame.contentDocument;
@@ -176,7 +173,7 @@ add_task(async function () {
let closeBtn = dialogOverlay.querySelector(".dialogClose");
closeBtn.doCommand();
ok(
BrowserTestUtils.is_hidden(dialogOverlay),
BrowserTestUtils.isHidden(dialogOverlay),
"The dialog should be invisible"
);

View File

@@ -1448,7 +1448,7 @@ add_task(async function testContentBlockingReloadWarning() {
"#contentBlockingOptionStrict .content-blocking-warning.reload-tabs"
);
ok(
!BrowserTestUtils.is_hidden(strictWarning),
!BrowserTestUtils.isHidden(strictWarning),
"The warning in the strict section should be showing"
);
@@ -1520,7 +1520,7 @@ add_task(async function testReloadTabsMessage() {
Services.prefs.setStringPref(CAT_PREF, "standard");
ok(
!BrowserTestUtils.is_hidden(standardWarning),
!BrowserTestUtils.isHidden(standardWarning),
"The warning in the standard section should be showing"
);
@@ -1538,7 +1538,7 @@ add_task(async function testReloadTabsMessage() {
await exampleTabBrowserDiscardedPromise;
ok(
BrowserTestUtils.is_hidden(standardWarning),
BrowserTestUtils.isHidden(standardWarning),
"The warning in the standard section should have hidden after being clicked"
);

View File

@@ -10,7 +10,7 @@ add_task(async function () {
contentDocument.getElementById("chooseLanguage").click();
const win = await promiseSubDialogLoaded;
dialogOverlay = content.gSubDialog._topDialog._overlay;
ok(!BrowserTestUtils.is_hidden(dialogOverlay), "The dialog is visible.");
ok(!BrowserTestUtils.isHidden(dialogOverlay), "The dialog is visible.");
return win;
}
@@ -19,14 +19,14 @@ add_task(async function () {
button.doCommand();
}
ok(BrowserTestUtils.is_hidden(dialogOverlay), "The dialog is invisible.");
ok(BrowserTestUtils.isHidden(dialogOverlay), "The dialog is invisible.");
let win = await languagesSubdialogOpened();
ok(
win.document.getElementById("spoofEnglish").hidden,
"The 'Request English' checkbox is hidden."
);
acceptLanguagesSubdialog(win);
ok(BrowserTestUtils.is_hidden(dialogOverlay), "The dialog is invisible.");
ok(BrowserTestUtils.isHidden(dialogOverlay), "The dialog is invisible.");
await SpecialPowers.pushPrefEnv({
set: [["intl.accept_languages", "en-US,en-XX,foo"]],

View File

@@ -345,9 +345,9 @@ add_task(async function test_aboutpreferences_search() {
"All products in the group are found"
);
let [mobile, monitor, vpn, relay] = productCards;
Assert.ok(BrowserTestUtils.is_hidden(mobile), "Mobile hidden");
Assert.ok(BrowserTestUtils.is_hidden(monitor), "Monitor hidden");
Assert.ok(BrowserTestUtils.is_hidden(vpn), "VPN hidden");
Assert.ok(BrowserTestUtils.isHidden(mobile), "Mobile hidden");
Assert.ok(BrowserTestUtils.isHidden(monitor), "Monitor hidden");
Assert.ok(BrowserTestUtils.isHidden(vpn), "VPN hidden");
Assert.ok(BrowserTestUtils.is_visible(relay), "Relay shown");
BrowserTestUtils.removeTab(tab);

View File

@@ -221,7 +221,7 @@ add_task(async function test_send_to_device_email_link_for_supported_locale() {
let doc = gBrowser.contentDocument;
let emailLink = doc.getElementById("simple-qr-code-send-email");
ok(!BrowserTestUtils.is_hidden(emailLink), "Email link should be visible");
ok(!BrowserTestUtils.isHidden(emailLink), "Email link should be visible");
await SpecialPowers.popPrefEnv();
BrowserTestUtils.removeTab(gBrowser.selectedTab);
@@ -246,7 +246,7 @@ add_task(
let doc = gBrowser.contentDocument;
let emailLink = doc.getElementById("simple-qr-code-send-email");
ok(BrowserTestUtils.is_hidden(emailLink), "Email link should be hidden");
ok(BrowserTestUtils.isHidden(emailLink), "Email link should be hidden");
await SpecialPowers.popPrefEnv();
BrowserTestUtils.removeTab(gBrowser.selectedTab);

View File

@@ -58,7 +58,7 @@ add_task(async function showSearchTermsVisibility_experiment_afterOpen() {
let doc = gBrowser.selectedBrowser.contentDocument;
let container = doc.getElementById(CHECKBOX_ID);
Assert.ok(
BrowserTestUtils.is_hidden(container),
BrowserTestUtils.isHidden(container),
"The option box is initially hidden."
);
@@ -76,7 +76,7 @@ add_task(async function showSearchTermsVisibility_experiment_afterOpen() {
});
Assert.ok(
BrowserTestUtils.is_hidden(container),
BrowserTestUtils.isHidden(container),
"The option box is hidden again after the experiment is uninstalled."
);

View File

@@ -9,12 +9,12 @@ const kDefaultWait = 2000;
function is_element_visible(aElement, aMsg) {
isnot(aElement, null, "Element should not be null, when checking visibility");
ok(!BrowserTestUtils.is_hidden(aElement), aMsg);
ok(!BrowserTestUtils.isHidden(aElement), aMsg);
}
function is_element_hidden(aElement, aMsg) {
isnot(aElement, null, "Element should not be null, when checking visibility");
ok(BrowserTestUtils.is_hidden(aElement), aMsg);
ok(BrowserTestUtils.isHidden(aElement), aMsg);
}
function open_preferences(aCallback) {

View File

@@ -43,12 +43,12 @@ function promiseSiteDataManagerSitesUpdated() {
function is_element_visible(aElement, aMsg) {
isnot(aElement, null, "Element should not be null, when checking visibility");
ok(!BrowserTestUtils.is_hidden(aElement), aMsg);
ok(!BrowserTestUtils.isHidden(aElement), aMsg);
}
function is_element_hidden(aElement, aMsg) {
isnot(aElement, null, "Element should not be null, when checking visibility");
ok(BrowserTestUtils.is_hidden(aElement), aMsg);
ok(BrowserTestUtils.isHidden(aElement), aMsg);
}
function promiseLoadSubDialog(aURL) {