Skip to content

Commit 0350564

Browse files
committed
Bug 1875090 - Rename ContentTaskUtils.is_hidden() to isHidden() r=Gijs,settings-reviewers,pip-reviewers,credential-management-reviewers,sgalich,kpatenio
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/D198830
1 parent 2a01092 commit 0350564

22 files changed

+74
-74
lines changed

browser/base/content/test/about/browser_aboutCertError_exception.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ add_task(async function checkBadStsCert() {
122122
: content.document;
123123
let exceptionButton = doc.getElementById("exceptionDialogButton");
124124
ok(
125-
ContentTaskUtils.is_hidden(exceptionButton),
125+
ContentTaskUtils.isHidden(exceptionButton),
126126
"Exception button is hidden."
127127
);
128128
}
@@ -191,7 +191,7 @@ add_task(async function checkhideAddExceptionButtonViaPref() {
191191

192192
let exceptionButton = doc.getElementById("exceptionDialogButton");
193193
ok(
194-
ContentTaskUtils.is_hidden(exceptionButton),
194+
ContentTaskUtils.isHidden(exceptionButton),
195195
"Exception button is hidden."
196196
);
197197
}
@@ -212,7 +212,7 @@ add_task(async function checkhideAddExceptionButtonInFrames() {
212212
let doc = content.document.querySelector("iframe").contentDocument;
213213
let exceptionButton = doc.getElementById("exceptionDialogButton");
214214
ok(
215-
ContentTaskUtils.is_hidden(exceptionButton),
215+
ContentTaskUtils.isHidden(exceptionButton),
216216
"Exception button is hidden."
217217
);
218218
});

browser/base/content/test/about/browser_bug633691.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ add_task(async function test() {
2323
let aP = content.document.getElementById("badCertAdvancedPanel");
2424
Assert.ok(aP, "Advanced content should exist");
2525
Assert.ok(
26-
ContentTaskUtils.is_hidden(aP),
26+
ContentTaskUtils.isHidden(aP),
2727
"Advanced content should not be visible by default"
2828
);
2929
});

browser/components/aboutlogins/tests/browser/browser_alertDismissedAfterChangingPassword.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ add_task(async function test_added_login_shows_breach_warning() {
8989
return loginItem._login && loginItem._login.guid == breachedLoginGuid;
9090
}, "waiting for breached login to get selected");
9191
Assert.ok(
92-
!ContentTaskUtils.is_hidden(
92+
!ContentTaskUtils.isHidden(
9393
loginItem.shadowRoot.querySelector("login-breach-alert")
9494
),
9595
"the breach alert should be visible"
@@ -155,7 +155,7 @@ add_task(async function test_added_login_shows_breach_warning() {
155155
}, "waiting for stored login to get updated");
156156

157157
Assert.ok(
158-
ContentTaskUtils.is_hidden(
158+
ContentTaskUtils.isHidden(
159159
loginItem.shadowRoot.querySelector("login-breach-alert")
160160
),
161161
"the breach alert should be hidden now"
@@ -183,7 +183,7 @@ add_task(async function test_added_login_shows_breach_warning() {
183183
return loginItem._login && loginItem._login.guid == vulnerableLoginGuid;
184184
}, "waiting for vulnerable login to get selected");
185185
Assert.ok(
186-
!ContentTaskUtils.is_hidden(
186+
!ContentTaskUtils.isHidden(
187187
loginItem.shadowRoot.querySelector("login-vulnerable-password-alert")
188188
),
189189
"the vulnerable alert should be visible"
@@ -205,7 +205,7 @@ add_task(async function test_added_login_shows_breach_warning() {
205205
}, "waiting for stored login to get updated");
206206

207207
Assert.ok(
208-
ContentTaskUtils.is_hidden(
208+
ContentTaskUtils.isHidden(
209209
loginItem.shadowRoot.querySelector("login-vulnerable-password-alert")
210210
),
211211
"the vulnerable alert should be hidden now"

browser/components/aboutlogins/tests/browser/browser_createLogin.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ add_task(async function test_create_login() {
6363
);
6464
let createButton = loginList._createLoginButton;
6565
Assert.ok(
66-
ContentTaskUtils.is_hidden(loginList._blankLoginListItem),
66+
ContentTaskUtils.isHidden(loginList._blankLoginListItem),
6767
"the blank login list item should be hidden initially"
6868
);
6969
Assert.ok(
@@ -111,7 +111,7 @@ add_task(async function test_create_login() {
111111

112112
// At this moment, the password input field is not focused so no warning should be displayed.
113113
Assert.ok(
114-
ContentTaskUtils.is_hidden(loginItem._passwordWarning),
114+
ContentTaskUtils.isHidden(loginItem._passwordWarning),
115115
"The password warning should not be visible if the password input field is not focused"
116116
);
117117

@@ -138,7 +138,7 @@ add_task(async function test_create_login() {
138138

139139
// Since the password field is focused, the origin warning should not be displayed.
140140
Assert.ok(
141-
ContentTaskUtils.is_hidden(loginItem._originWarning),
141+
ContentTaskUtils.isHidden(loginItem._originWarning),
142142
"The origin warning should not be visible if the origin input field is not focused"
143143
);
144144

@@ -178,7 +178,7 @@ add_task(async function test_create_login() {
178178
"login-list should no longer be in no logins view"
179179
);
180180
Assert.ok(
181-
ContentTaskUtils.is_hidden(loginList._blankLoginListItem),
181+
ContentTaskUtils.isHidden(loginList._blankLoginListItem),
182182
"the blank login list item should be hidden after adding new login"
183183
);
184184
Assert.ok(
@@ -343,7 +343,7 @@ add_task(async function test_cancel_create_login() {
343343
"there should be a selected guid before create mode"
344344
);
345345
Assert.ok(
346-
ContentTaskUtils.is_hidden(loginList._blankLoginListItem),
346+
ContentTaskUtils.isHidden(loginList._blankLoginListItem),
347347
"the blank login list item should be hidden before create mode"
348348
);
349349

@@ -368,7 +368,7 @@ add_task(async function test_cancel_create_login() {
368368
"there should be a selected guid after canceling create mode"
369369
);
370370
Assert.ok(
371-
ContentTaskUtils.is_hidden(loginList._blankLoginListItem),
371+
ContentTaskUtils.isHidden(loginList._blankLoginListItem),
372372
"the blank login list item should be hidden after canceling create mode"
373373
);
374374
});

browser/components/aboutlogins/tests/browser/browser_noLoginsView.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,20 @@ add_task(async function test_no_logins_class() {
4444
let loginListList = loginList.shadowRoot.querySelector("ol");
4545

4646
Assert.ok(
47-
!ContentTaskUtils.is_hidden(loginIntro),
47+
!ContentTaskUtils.isHidden(loginIntro),
4848
"login-intro should be shown in no logins view"
4949
);
5050
Assert.ok(
51-
!ContentTaskUtils.is_hidden(loginListIntro),
51+
!ContentTaskUtils.isHidden(loginListIntro),
5252
"login-list intro should be shown in no logins view"
5353
);
5454

5555
Assert.ok(
56-
ContentTaskUtils.is_hidden(loginItem),
56+
ContentTaskUtils.isHidden(loginItem),
5757
"login-item should be hidden in no logins view"
5858
);
5959
Assert.ok(
60-
ContentTaskUtils.is_hidden(loginListList),
60+
ContentTaskUtils.isHidden(loginListList),
6161
"login-list logins list should be hidden in no logins view"
6262
);
6363
Assert.equal(
@@ -90,7 +90,7 @@ add_task(async function test_no_logins_class() {
9090
? ".intro-import-text.file-import"
9191
: ".intro-import-text.no-file-import";
9292
Assert.equal(
93-
ContentTaskUtils.is_hidden(
93+
ContentTaskUtils.isHidden(
9494
loginIntro.shadowRoot.querySelector(importClass)
9595
),
9696
aPlatform == "linux",
@@ -136,11 +136,11 @@ add_task(
136136
"login-item should be marked as having no-logins"
137137
);
138138
Assert.ok(
139-
ContentTaskUtils.is_hidden(loginItem),
139+
ContentTaskUtils.isHidden(loginItem),
140140
"login-item should be hidden"
141141
);
142142
Assert.ok(
143-
!ContentTaskUtils.is_hidden(loginIntro),
143+
!ContentTaskUtils.isHidden(loginIntro),
144144
"login-intro should be visible"
145145
);
146146
});
@@ -186,11 +186,11 @@ add_task(
186186
"the login-item should have the newly added login selected"
187187
);
188188
Assert.ok(
189-
!ContentTaskUtils.is_hidden(loginItem),
189+
!ContentTaskUtils.isHidden(loginItem),
190190
"login-item should be visible"
191191
);
192192
Assert.ok(
193-
ContentTaskUtils.is_hidden(loginIntro),
193+
ContentTaskUtils.isHidden(loginIntro),
194194
"login-intro should be hidden"
195195
);
196196
}

browser/components/aboutlogins/tests/browser/browser_openFiltered.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ add_task(async function test_query_parameter_filter() {
6666
);
6767
const loginIntro = content.document.querySelector("login-intro");
6868
Assert.ok(
69-
ContentTaskUtils.is_hidden(loginIntro),
69+
ContentTaskUtils.isHidden(loginIntro),
7070
"login-intro should be hidden when a login is selected"
7171
);
7272

@@ -154,12 +154,12 @@ add_task(async function test_query_parameter_filter_no_logins_for_site() {
154154
);
155155

156156
Assert.ok(
157-
ContentTaskUtils.is_hidden(loginList._list),
157+
ContentTaskUtils.isHidden(loginList._list),
158158
"the login list should be hidden when there is a search with no results"
159159
);
160160
let intro = loginList.shadowRoot.querySelector(".intro");
161161
Assert.ok(
162-
ContentTaskUtils.is_hidden(intro),
162+
ContentTaskUtils.isHidden(intro),
163163
"the intro should be hidden when there is a search with no results"
164164
);
165165
let emptySearchMessage = loginList.shadowRoot.querySelector(
@@ -184,12 +184,12 @@ add_task(async function test_query_parameter_filter_no_logins_for_site() {
184184
Assert.ok(!loginItem.dataset.isNewLogin, "should not be in create mode");
185185
Assert.ok(!loginItem.dataset.editing, "should not be in edit mode");
186186
Assert.ok(
187-
ContentTaskUtils.is_hidden(loginItem),
187+
ContentTaskUtils.isHidden(loginItem),
188188
"login-item should be hidden when a login is not selected and we're not in create mode"
189189
);
190190
let loginIntro = content.document.querySelector("login-intro");
191191
Assert.ok(
192-
ContentTaskUtils.is_hidden(loginIntro),
192+
ContentTaskUtils.isHidden(loginIntro),
193193
"login-intro should be hidden when a login is not selected and we're not in create mode"
194194
);
195195

@@ -202,7 +202,7 @@ add_task(async function test_query_parameter_filter_no_logins_for_site() {
202202
"login-item should be visible in create mode"
203203
);
204204
Assert.ok(
205-
ContentTaskUtils.is_hidden(loginIntro),
205+
ContentTaskUtils.isHidden(loginIntro),
206206
"login-intro should be hidden in create mode"
207207
);
208208
});
@@ -234,7 +234,7 @@ add_task(async function test_query_parameter_filter_no_login_until_backspace() {
234234
);
235235

236236
Assert.ok(
237-
ContentTaskUtils.is_hidden(loginList._list),
237+
ContentTaskUtils.isHidden(loginList._list),
238238
"the login list should be hidden when there is a search with no results"
239239
);
240240

@@ -244,14 +244,14 @@ add_task(async function test_query_parameter_filter_no_login_until_backspace() {
244244

245245
let intro = loginList.shadowRoot.querySelector(".intro");
246246
Assert.ok(
247-
ContentTaskUtils.is_hidden(intro),
247+
ContentTaskUtils.isHidden(intro),
248248
"the intro should be hidden when there is no selection"
249249
);
250250
let emptySearchMessage = loginList.shadowRoot.querySelector(
251251
".empty-search-message"
252252
);
253253
Assert.ok(
254-
ContentTaskUtils.is_hidden(emptySearchMessage),
254+
ContentTaskUtils.isHidden(emptySearchMessage),
255255
"the empty search message should be hidden when there is matching logins"
256256
);
257257

@@ -273,12 +273,12 @@ add_task(async function test_query_parameter_filter_no_login_until_backspace() {
273273
Assert.ok(!loginItem.dataset.isNewLogin, "should not be in create mode");
274274
Assert.ok(!loginItem.dataset.editing, "should not be in edit mode");
275275
Assert.ok(
276-
ContentTaskUtils.is_hidden(loginItem),
276+
ContentTaskUtils.isHidden(loginItem),
277277
"login-item should be hidden when a login is not selected and we're not in create mode"
278278
);
279279
let loginIntro = content.document.querySelector("login-intro");
280280
Assert.ok(
281-
ContentTaskUtils.is_hidden(loginIntro),
281+
ContentTaskUtils.isHidden(loginIntro),
282282
"login-intro should be hidden when a login is not selected and we're not in create mode"
283283
);
284284

@@ -291,7 +291,7 @@ add_task(async function test_query_parameter_filter_no_login_until_backspace() {
291291
"login-item should be visible in create mode"
292292
);
293293
Assert.ok(
294-
ContentTaskUtils.is_hidden(loginIntro),
294+
ContentTaskUtils.isHidden(loginIntro),
295295
"login-intro should be hidden in create mode"
296296
);
297297
});

browser/components/preferences/tests/browser_defaultbrowser_alwayscheck.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ add_task(async function clicking_make_default_checks_alwaysCheck_checkbox() {
1313
let isNotDefaultPane =
1414
content.document.getElementById("isNotDefaultPane");
1515
Assert.equal(
16-
ContentTaskUtils.is_hidden(isDefaultPane),
16+
ContentTaskUtils.isHidden(isDefaultPane),
1717
!isDefault,
1818
"The 'browser is default' pane should be hidden when browser is not default"
1919
);
2020
Assert.equal(
21-
ContentTaskUtils.is_hidden(isNotDefaultPane),
21+
ContentTaskUtils.isHidden(isNotDefaultPane),
2222
isDefault,
2323
"The 'make default' pane should be hidden when browser is default"
2424
);
@@ -73,7 +73,7 @@ add_task(async function clicking_make_default_checks_alwaysCheck_checkbox() {
7373
let isDefaultPane = content.document.getElementById("isDefaultPane");
7474
let isNotDefaultPane = content.document.getElementById("isNotDefaultPane");
7575
Assert.ok(
76-
ContentTaskUtils.is_hidden(isDefaultPane),
76+
ContentTaskUtils.isHidden(isDefaultPane),
7777
"The 'browser is default' pane should be hidden when not default"
7878
);
7979
Assert.ok(

browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about_search_banner.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ add_task(async function test_show_banner_close_no_more() {
237237

238238
await ContentTaskUtils.waitForCondition(
239239
() =>
240-
ContentTaskUtils.is_hidden(
240+
ContentTaskUtils.isHidden(
241241
content.document.getElementById("search-banner")
242242
),
243243
"should have closed the in-content search banner after clicking close"

browser/components/protections/test/browser/browser_protections_lockwise.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ add_task(async function testNoLoginsLockwiseCardUI() {
3434
"#lockwise-how-it-works"
3535
);
3636
ok(
37-
ContentTaskUtils.is_hidden(lockwiseHowItWorks),
37+
ContentTaskUtils.isHidden(lockwiseHowItWorks),
3838
"How it works link is hidden"
3939
);
4040

@@ -52,15 +52,15 @@ add_task(async function testNoLoginsLockwiseCardUI() {
5252
".lockwise-scanned-wrapper"
5353
);
5454
ok(
55-
ContentTaskUtils.is_hidden(lockwiseScannedWrapper),
55+
ContentTaskUtils.isHidden(lockwiseScannedWrapper),
5656
"Lockwise scanned wrapper is hidden"
5757
);
5858

5959
const managePasswordsButton = content.document.querySelector(
6060
"#manage-passwords-button"
6161
);
6262
ok(
63-
ContentTaskUtils.is_hidden(managePasswordsButton),
63+
ContentTaskUtils.isHidden(managePasswordsButton),
6464
"Manage passwords button is hidden"
6565
);
6666

@@ -156,7 +156,7 @@ add_task(async function testLockwiseCardUIWithLogins() {
156156
"#save-passwords-button"
157157
);
158158
ok(
159-
ContentTaskUtils.is_hidden(savePasswordsButton),
159+
ContentTaskUtils.isHidden(savePasswordsButton),
160160
"Save passwords button is hidden"
161161
);
162162

@@ -278,7 +278,7 @@ add_task(async function testLockwiseCardPref() {
278278
return !lockwiseCard["data-enabled"];
279279
}, "Lockwise card is not enabled.");
280280

281-
ok(ContentTaskUtils.is_hidden(lockwiseCard), "Lockwise card is hidden.");
281+
ok(ContentTaskUtils.isHidden(lockwiseCard), "Lockwise card is hidden.");
282282
});
283283

284284
// Set the pref back to displaying the card.

browser/components/protections/test/browser/browser_protections_monitor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ add_task(async function () {
114114
}, "Monitor card is not enabled.");
115115

116116
const monitorCard = content.document.querySelector(".monitor-card");
117-
ok(ContentTaskUtils.is_hidden(monitorCard), "Monitor card is hidden.");
117+
ok(ContentTaskUtils.isHidden(monitorCard), "Monitor card is hidden.");
118118
});
119119

120120
if (monitorCardEnabled) {
@@ -149,7 +149,7 @@ async function checkNoLoginsContentIsDisplayed(tab, expectedLinkContent) {
149149
const cardBody = content.document.querySelector(".monitor-card .card-body");
150150

151151
ok(
152-
ContentTaskUtils.is_hidden(cardBody),
152+
ContentTaskUtils.isHidden(cardBody),
153153
"Card body is hidden for users with no logins."
154154
);
155155
is(

browser/components/protections/test/browser/browser_protections_proxy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ add_task(async function () {
3232
}, "Proxy card is not enabled.");
3333

3434
const proxyCard = content.document.querySelector(".proxy-card");
35-
ok(ContentTaskUtils.is_hidden(proxyCard), "Proxy card is hidden.");
35+
ok(ContentTaskUtils.isHidden(proxyCard), "Proxy card is hidden.");
3636
});
3737

3838
info("Enable showing the Secure Proxy card");
@@ -97,7 +97,7 @@ async function checkProxyCardVisibility(tab, shouldBeHidden) {
9797
async function ({ _shouldBeHidden }) {
9898
await ContentTaskUtils.waitForCondition(() => {
9999
const proxyCard = content.document.querySelector(".proxy-card");
100-
return ContentTaskUtils.is_hidden(proxyCard) === _shouldBeHidden;
100+
return ContentTaskUtils.isHidden(proxyCard) === _shouldBeHidden;
101101
});
102102

103103
const visibilityState = _shouldBeHidden ? "hidden" : "shown";

0 commit comments

Comments
 (0)