Skip to content

Commit 736a598

Browse files
committed
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
1 parent 3fb4935 commit 736a598

File tree

77 files changed

+164
-173
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+164
-173
lines changed

browser/base/content/test/permissions/browser_autoplay_blocked.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ async function blockedIconShown() {
6161

6262
async function blockedIconHidden() {
6363
await TestUtils.waitForCondition(() => {
64-
return BrowserTestUtils.is_hidden(autoplayBlockedIcon());
64+
return BrowserTestUtils.isHidden(autoplayBlockedIcon());
6565
}, "Blocked icon is hidden");
6666
}
6767

@@ -91,7 +91,7 @@ add_task(async function testMainViewVisible() {
9191

9292
await BrowserTestUtils.withNewTab(AUTOPLAY_PAGE, async function () {
9393
ok(
94-
BrowserTestUtils.is_hidden(autoplayBlockedIcon()),
94+
BrowserTestUtils.isHidden(autoplayBlockedIcon()),
9595
"Blocked icon not shown"
9696
);
9797

@@ -265,7 +265,7 @@ add_task(async function testChangingBlockingSettingDuringNavigation() {
265265
// would have shown.
266266
await sleep(100);
267267
ok(
268-
BrowserTestUtils.is_hidden(autoplayBlockedIcon()),
268+
BrowserTestUtils.isHidden(autoplayBlockedIcon()),
269269
"Blocked icon is hidden"
270270
);
271271
});

browser/base/content/test/permissions/browser_permissions.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ add_task(async function testPermissionHints() {
207207

208208
await openPermissionPopup();
209209

210-
ok(BrowserTestUtils.is_hidden(reloadHint), "Reload hint is hidden");
210+
ok(BrowserTestUtils.isHidden(reloadHint), "Reload hint is hidden");
211211

212212
await closePermissionPopup();
213213

@@ -224,18 +224,18 @@ add_task(async function testPermissionHints() {
224224

225225
await openPermissionPopup();
226226

227-
ok(BrowserTestUtils.is_hidden(reloadHint), "Reload hint is hidden");
227+
ok(BrowserTestUtils.isHidden(reloadHint), "Reload hint is hidden");
228228

229229
let cancelButtons = permissionsList.querySelectorAll(
230230
".permission-popup-permission-remove-button"
231231
);
232232
PermissionTestUtils.remove(gBrowser.currentURI, "camera");
233233

234234
cancelButtons[0].click();
235-
ok(!BrowserTestUtils.is_hidden(reloadHint), "Reload hint is visible");
235+
ok(!BrowserTestUtils.isHidden(reloadHint), "Reload hint is visible");
236236

237237
cancelButtons[1].click();
238-
ok(!BrowserTestUtils.is_hidden(reloadHint), "Reload hint is visible");
238+
ok(!BrowserTestUtils.isHidden(reloadHint), "Reload hint is visible");
239239

240240
await closePermissionPopup();
241241
let loaded = BrowserTestUtils.browserLoaded(browser);
@@ -244,7 +244,7 @@ add_task(async function testPermissionHints() {
244244
await openPermissionPopup();
245245

246246
ok(
247-
BrowserTestUtils.is_hidden(reloadHint),
247+
BrowserTestUtils.isHidden(reloadHint),
248248
"Reload hint is hidden after reloading"
249249
);
250250

@@ -425,14 +425,14 @@ add_task(async function testPolicyPermission() {
425425
add_task(async function testHiddenAfterRefresh() {
426426
await BrowserTestUtils.withNewTab(PERMISSIONS_PAGE, async function (browser) {
427427
ok(
428-
BrowserTestUtils.is_hidden(gPermissionPanel._permissionPopup),
428+
BrowserTestUtils.isHidden(gPermissionPanel._permissionPopup),
429429
"Popup is hidden"
430430
);
431431

432432
await openPermissionPopup();
433433

434434
ok(
435-
!BrowserTestUtils.is_hidden(gPermissionPanel._permissionPopup),
435+
!BrowserTestUtils.isHidden(gPermissionPanel._permissionPopup),
436436
"Popup is shown"
437437
);
438438

@@ -445,7 +445,7 @@ add_task(async function testHiddenAfterRefresh() {
445445
await reloaded;
446446

447447
ok(
448-
BrowserTestUtils.is_hidden(gPermissionPanel._permissionPopup),
448+
BrowserTestUtils.isHidden(gPermissionPanel._permissionPopup),
449449
"Popup is hidden"
450450
);
451451
});
@@ -470,7 +470,7 @@ async function helper3rdPartyStoragePermissionTest(permissionID) {
470470
testPermListHasEntries(false);
471471

472472
ok(
473-
BrowserTestUtils.is_hidden(storagePermissionAnchor.firstElementChild),
473+
BrowserTestUtils.isHidden(storagePermissionAnchor.firstElementChild),
474474
"Anchor header is hidden"
475475
);
476476

@@ -552,7 +552,7 @@ async function helper3rdPartyStoragePermissionTest(permissionID) {
552552

553553
testPermListHasEntries(true);
554554
ok(
555-
BrowserTestUtils.is_hidden(storagePermissionAnchor.firstElementChild),
555+
BrowserTestUtils.isHidden(storagePermissionAnchor.firstElementChild),
556556
"Anchor header is hidden"
557557
);
558558

@@ -569,7 +569,7 @@ async function helper3rdPartyStoragePermissionTest(permissionID) {
569569

570570
testPermListHasEntries(false);
571571
ok(
572-
BrowserTestUtils.is_hidden(storagePermissionAnchor.firstElementChild),
572+
BrowserTestUtils.isHidden(storagePermissionAnchor.firstElementChild),
573573
"Anchor header is hidden"
574574
);
575575

@@ -601,7 +601,7 @@ add_task(async function test3rdPartyBothStoragePermission() {
601601
testPermListHasEntries(false);
602602

603603
ok(
604-
BrowserTestUtils.is_hidden(storagePermissionAnchor.firstElementChild),
604+
BrowserTestUtils.isHidden(storagePermissionAnchor.firstElementChild),
605605
"Anchor header is hidden"
606606
);
607607

browser/base/content/test/protectionsUI/browser_protectionsUI.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ add_task(async function testToggleSwitch() {
124124

125125
// The 'Site Fixed?' link should be hidden.
126126
ok(
127-
BrowserTestUtils.is_hidden(
127+
BrowserTestUtils.isHidden(
128128
gProtectionsHandler._protectionsPopupTPSwitchBreakageFixedLink
129129
),
130130
"The 'Site Fixed?' link should be hidden."
@@ -179,14 +179,14 @@ add_task(async function testToggleSwitch() {
179179

180180
// The 'Site not working?' link should be hidden after clicking the TP switch.
181181
ok(
182-
BrowserTestUtils.is_hidden(
182+
BrowserTestUtils.isHidden(
183183
gProtectionsHandler._protectionsPopupTPSwitchBreakageLink
184184
),
185185
"The 'Site not working?' link should be hidden after TP switch turns to off."
186186
);
187187
// Same for the 'Site Fixed?' link
188188
ok(
189-
BrowserTestUtils.is_hidden(
189+
BrowserTestUtils.isHidden(
190190
gProtectionsHandler._protectionsPopupTPSwitchBreakageFixedLink
191191
),
192192
"The 'Site Fixed?' link should be hidden."
@@ -221,7 +221,7 @@ add_task(async function testToggleSwitch() {
221221

222222
// The 'Site not working?' link should be hidden if the TP is off.
223223
ok(
224-
BrowserTestUtils.is_hidden(
224+
BrowserTestUtils.isHidden(
225225
gProtectionsHandler._protectionsPopupTPSwitchBreakageLink
226226
),
227227
"The 'Site not working?' link should be hidden if TP is off."
@@ -252,14 +252,14 @@ add_task(async function testToggleSwitch() {
252252
await clickToggle(gProtectionsHandler._protectionsPopupTPSwitch);
253253

254254
ok(
255-
BrowserTestUtils.is_hidden(
255+
BrowserTestUtils.isHidden(
256256
gProtectionsHandler._protectionsPopupTPSwitchBreakageLink
257257
),
258258
`The 'Site not working?' link should be still hidden after toggling TP
259259
switch to on from off.`
260260
);
261261
ok(
262-
BrowserTestUtils.is_hidden(
262+
BrowserTestUtils.isHidden(
263263
gProtectionsHandler._protectionsPopupTPSwitchBreakageFixedLink
264264
),
265265
"The 'Site Fixed?' link should be hidden."
@@ -600,7 +600,7 @@ add_task(async function testNumberOfBlockedTrackers() {
600600
// Check that whether the counter is not shown if the number of blocked
601601
// trackers is zero.
602602
ok(
603-
BrowserTestUtils.is_hidden(trackerCounterBox),
603+
BrowserTestUtils.isHidden(trackerCounterBox),
604604
"The blocked tracker counter is hidden if there is no blocked tracker."
605605
);
606606

browser/base/content/test/protectionsUI/browser_protectionsUI_fingerprinters.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ async function testIdentityState(hasException) {
6060
"fingerprinters are not detected"
6161
);
6262
ok(
63-
!BrowserTestUtils.is_hidden(gProtectionsHandler.iconBox),
63+
!BrowserTestUtils.isHidden(gProtectionsHandler.iconBox),
6464
"icon box is visible regardless the exception"
6565
);
6666

browser/base/content/test/protectionsUI/browser_protectionsUI_report_breakage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ add_task(async function testNoTracking() {
176176
"protections-popup-tp-switch-breakage-link"
177177
);
178178
ok(
179-
BrowserTestUtils.is_hidden(siteNotWorkingButton),
179+
BrowserTestUtils.isHidden(siteNotWorkingButton),
180180
"site not working button is not visible"
181181
);
182182
});
@@ -403,7 +403,7 @@ async function testReportBreakageSubmit(url, tags, error, hasException) {
403403
);
404404
gProtectionsHandler._protectionsPopup.hidePopup();
405405
} else {
406-
ok(BrowserTestUtils.is_hidden(errorMessage), "Error message not shown");
406+
ok(BrowserTestUtils.isHidden(errorMessage), "Error message not shown");
407407
}
408408

409409
await popuphidden;

browser/base/content/test/protectionsUI/browser_protectionsUI_shield_visibility.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ add_task(async function () {
112112
await pageLoaded;
113113

114114
is(
115-
BrowserTestUtils.is_hidden(
115+
BrowserTestUtils.isHidden(
116116
gProtectionsHandler._trackingProtectionIconContainer
117117
),
118118
testData.hidden,

browser/base/content/test/protectionsUI/browser_protectionsUI_state.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ async function testBenignPageWithException() {
113113
);
114114

115115
ok(
116-
!BrowserTestUtils.is_hidden(gProtectionsHandler.iconBox),
116+
!BrowserTestUtils.isHidden(gProtectionsHandler.iconBox),
117117
"icon box is not hidden"
118118
);
119119

browser/base/content/test/protectionsUI/browser_protectionsUI_subview_shim.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ async function assertSubViewState(category, expectedState) {
167167
"Shim allow hint is visible."
168168
);
169169
} else {
170-
BrowserTestUtils.is_hidden(shimAllowSection, "Shim allow hint is hidden.");
170+
BrowserTestUtils.isHidden(shimAllowSection, "Shim allow hint is hidden.");
171171
}
172172

173173
await closeProtectionsPanel();

browser/base/content/test/siteIdentity/browser_identityPopup_custom_roots.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ add_task(async function test_http() {
6262
"identity-popup-security-decription-custom-root"
6363
);
6464
ok(
65-
BrowserTestUtils.is_hidden(customRootWarning),
65+
BrowserTestUtils.isHidden(customRootWarning),
6666
"custom root warning is hidden"
6767
);
6868

@@ -75,7 +75,7 @@ add_task(async function test_http() {
7575
"identity-popup-content-verifier-unknown"
7676
);
7777
ok(
78-
BrowserTestUtils.is_hidden(subPanelInfo),
78+
BrowserTestUtils.isHidden(subPanelInfo),
7979
"custom root warning in sub panel is hidden"
8080
);
8181
});

browser/base/content/test/siteIdentity/browser_identity_UI.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ async function runTest(i, forward) {
130130
await popupHidden;
131131
ok(
132132
!gIdentityHandler._identityPopup ||
133-
BrowserTestUtils.is_hidden(gIdentityHandler._identityPopup),
133+
BrowserTestUtils.isHidden(gIdentityHandler._identityPopup),
134134
"Control Center is hidden"
135135
);
136136

@@ -160,7 +160,7 @@ async function runTest(i, forward) {
160160
info("Waiting for the Control Center to be shown");
161161
await popupShown;
162162
ok(
163-
!BrowserTestUtils.is_hidden(gIdentityHandler._identityPopup),
163+
!BrowserTestUtils.isHidden(gIdentityHandler._identityPopup),
164164
"Control Center is visible"
165165
);
166166
let displayedHost = currentTest.hostForDisplay || currentTest.location;

browser/base/content/test/siteIdentity/head.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ async function assertMixedContentBlockingState(tabbrowser, states = {}) {
167167
// HTTP request, there should be a broken padlock shown always.
168168
ok(classList.contains("notSecure"), "notSecure on HTTP page");
169169
ok(
170-
!BrowserTestUtils.is_hidden(identityIcon),
170+
!BrowserTestUtils.isHidden(identityIcon),
171171
"information icon should be visible"
172172
);
173173

@@ -202,7 +202,7 @@ async function assertMixedContentBlockingState(tabbrowser, states = {}) {
202202
);
203203

204204
ok(
205-
!BrowserTestUtils.is_hidden(identityIcon),
205+
!BrowserTestUtils.isHidden(identityIcon),
206206
"information icon should be visible"
207207
);
208208
if (activeLoaded) {
@@ -377,7 +377,7 @@ async function assertMixedContentBlockingState(tabbrowser, states = {}) {
377377
doc
378378
.getElementById("identity-popup-securityView")
379379
.querySelectorAll(".identity-popup-mcb-learn-more"),
380-
element => !BrowserTestUtils.is_hidden(element)
380+
element => !BrowserTestUtils.isHidden(element)
381381
).length,
382382
1,
383383
"The 'Learn more' link should be visible once."

browser/base/content/test/tabPrompts/browser_contentOrigins.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ async function checkDialog(
8484

8585
ok(BrowserTestUtils.is_visible(titleEl), "New title should be shown.");
8686
ok(
87-
BrowserTestUtils.is_hidden(doc.getElementById("infoTitle")),
87+
BrowserTestUtils.isHidden(doc.getElementById("infoTitle")),
8888
"Old title should be hidden."
8989
);
9090
let iconCS = doc.ownerGlobal.getComputedStyle(

browser/base/content/test/tabdialogs/browser_tabdialogbox_focus.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ add_task(async function test_tabdialogbox_tab_switch_hidden() {
192192
dialogBoxManager.hideDialog(browser);
193193

194194
ok(
195-
BrowserTestUtils.is_hidden(dialogBoxManager._dialogStack),
195+
BrowserTestUtils.isHidden(dialogBoxManager._dialogStack),
196196
"Dialog stack is hidden"
197197
);
198198

browser/base/content/test/tabdialogs/browser_tabdialogbox_navigation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ add_task(async function test_tabdialogbox_hide() {
145145
await Promise.all(dialogs.map(dialog => dialog._dialogReady));
146146

147147
ok(
148-
!BrowserTestUtils.is_hidden(dialogBoxManager._dialogStack),
148+
!BrowserTestUtils.isHidden(dialogBoxManager._dialogStack),
149149
"Dialog stack is showing"
150150
);
151151

@@ -158,7 +158,7 @@ add_task(async function test_tabdialogbox_hide() {
158158
);
159159

160160
ok(
161-
BrowserTestUtils.is_hidden(dialogBoxManager._dialogStack),
161+
BrowserTestUtils.isHidden(dialogBoxManager._dialogStack),
162162
"Dialog stack is hidden"
163163
);
164164

browser/base/content/test/tabs/browser_tab_manager_visibility.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ add_task(async function tab_manager_visibility_preference_off() {
4141
},
4242
async function (browser) {
4343
await Assert.ok(
44-
BrowserTestUtils.is_hidden(
44+
BrowserTestUtils.isHidden(
4545
newWindow.document.getElementById("alltabs-button")
4646
),
4747
"tab manage menu is hidden when browser.tabs.tabmanager.enabled preference is set to true"

browser/base/content/test/webrtc/browser_stop_sharing_button.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ add_task(async function test_stop_sharing() {
4848

4949
// Ensure that the "display-share" section of the indicator is now hidden
5050
Assert.ok(
51-
BrowserTestUtils.is_hidden(
51+
BrowserTestUtils.isHidden(
5252
indicator.document.getElementById("display-share")
5353
),
5454
"The display-share section of the indicator should now be hidden."
@@ -98,7 +98,7 @@ add_task(async function test_stop_sharing_multiple() {
9898

9999
// Ensure that the "display-share" section of the indicator is now hidden
100100
Assert.ok(
101-
BrowserTestUtils.is_hidden(
101+
BrowserTestUtils.isHidden(
102102
indicator.document.getElementById("display-share")
103103
),
104104
"The display-share section of the indicator should now be hidden."
@@ -138,7 +138,7 @@ add_task(async function test_keep_permissions() {
138138

139139
// Ensure that the "display-share" section of the indicator is now hidden
140140
Assert.ok(
141-
BrowserTestUtils.is_hidden(
141+
BrowserTestUtils.isHidden(
142142
indicator.document.getElementById("display-share")
143143
),
144144
"The display-share section of the indicator should now be hidden."

0 commit comments

Comments
 (0)