Skip to content

Commit

Permalink
Bug 1811278 - Add disable next line for all browser/base PART 3 r=mossop
Browse files Browse the repository at this point in the history
  • Loading branch information
moztomer committed Jan 25, 2023
1 parent 6c46b53 commit a81ef17
Show file tree
Hide file tree
Showing 37 changed files with 103 additions and 36 deletions.
36 changes: 0 additions & 36 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -574,42 +574,6 @@ module.exports = {
// That are all files that produes warnings in the existing test infrastructure.
// Since our focus is that new tests won't use http without thinking twice we exempt
// these test files for now. Bug 1758951
"browser/base/content/test/performance/browser_preferences_usage.js",
"browser/base/content/test/performance/browser_startup_content.js",
"browser/base/content/test/performance/browser_startup_content_subframe.js",
"browser/base/content/test/performance/browser_window_resize.js",
"browser/base/content/test/performance/head.js",
"browser/base/content/test/popupNotifications/browser_popupNotification.js",
"browser/base/content/test/popupNotifications/browser_popupNotification_2.js",
"browser/base/content/test/popupNotifications/browser_popupNotification_3.js",
"browser/base/content/test/popupNotifications/browser_popupNotification_4.js",
"browser/base/content/test/popupNotifications/browser_popupNotification_5.js",
"browser/base/content/test/popupNotifications/browser_popupNotification_no_anchors.js",
"browser/base/content/test/popupNotifications/browser_reshow_in_background.js",
"browser/base/content/test/popupNotifications/head.js",
"browser/base/content/test/popups/browser_popup_blocker_frames.js",
"browser/base/content/test/popups/browser_popup_blocker_identity_block.js",
"browser/base/content/test/popups/browser_popup_blocker_iframes.js",
"browser/base/content/test/popups/browser_popup_frames.js",
"browser/base/content/test/protectionsUI/browser_protectionsUI.js",
"browser/base/content/test/protectionsUI/browser_protectionsUI_background_tabs.js",
"browser/base/content/test/protectionsUI/browser_protectionsUI_categories.js",
"browser/base/content/test/protectionsUI/browser_protectionsUI_cookies_subview.js",
"browser/base/content/test/protectionsUI/browser_protectionsUI_cryptominers.js",
"browser/base/content/test/protectionsUI/browser_protectionsUI_fingerprinters.js",
"browser/base/content/test/protectionsUI/browser_protectionsUI_icon_state.js",
"browser/base/content/test/protectionsUI/browser_protectionsUI_open_preferences.js",
"browser/base/content/test/protectionsUI/browser_protectionsUI_pbmode_exceptions.js",
"browser/base/content/test/protectionsUI/browser_protectionsUI_report_breakage.js",
"browser/base/content/test/protectionsUI/browser_protectionsUI_shield_visibility.js",
"browser/base/content/test/protectionsUI/browser_protectionsUI_socialtracking.js",
"browser/base/content/test/protectionsUI/browser_protectionsUI_state.js",
"browser/base/content/test/protectionsUI/browser_protectionsUI_state_reset.js",
"browser/base/content/test/protectionsUI/browser_protectionsUI_subview_shim.js",
"browser/base/content/test/protectionsUI/browser_protectionsUI_telemetry.js",
"browser/base/content/test/protectionsUI/browser_protectionsUI_trackers_subview.js",
"browser/base/content/test/protectionsUI/file_protectionsUI_fetch.html",
"browser/base/content/test/protectionsUI/trackingAPI.js",
"browser/base/content/test/referrer/browser_referrer_click_pinned_tab.js",
"browser/base/content/test/referrer/head.js",
"browser/base/content/test/siteIdentity/browser_about_blank_same_document_tabswitch.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ add_task(async function open_10_tabs() {
tabs.push(
await BrowserTestUtils.openNewForegroundTab(
gBrowser,
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com",
true,
true
Expand Down Expand Up @@ -259,14 +260,17 @@ add_task(async function navigate_around() {

let tab = await BrowserTestUtils.openNewForegroundTab(
gBrowser,
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com",
true,
true
);

let urls = [
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com/",
"https://example.com/",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.org/",
"https://example.org/",
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ add_task(async function() {
url:
getRootDirectory(gTestPath).replace(
"chrome://mochitests/content",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com"
) + "file_empty.html",
forceNewProcess: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const actorModuleURI =
const subframeURI =
getRootDirectory(gTestPath).replace(
"chrome://mochitests/content",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com"
) + "file_empty.html";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ add_task(async function() {
guid: PlacesUtils.bookmarks.toolbarGuid,
children: Array(BOOKMARKS_COUNT)
.fill("")
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
.map((_, i) => ({ url: `http://test.places.${i}/` })),
});

Expand Down
1 change: 1 addition & 0 deletions browser/base/content/test/performance/head.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ async function addDummyHistoryEntries(searchStr = "") {

for (let i = 0; i < NUM_VISITS; ++i) {
visits.push({
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
uri: `http://example.com/urlbar-reflows-${i}`,
title: `Reflow test for URL bar entry #${i} - ${searchStr}`,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ var tests = [
{
id: "Test#4",
async run() {
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
let tab = BrowserTestUtils.addTab(gBrowser, "http://example.com/");
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
isnot(gBrowser.selectedTab, tab, "new tab isn't selected");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ var tests = [
this.oldSelectedTab = gBrowser.selectedTab;
await BrowserTestUtils.openNewForegroundTab(
gBrowser,
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com/"
);
this.notifyObj = new BasicNotification(this.id);
Expand All @@ -85,10 +86,13 @@ var tests = [
},
async onShown(popup) {
this.complete = false;
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
await promiseTabLoadEvent(gBrowser.selectedTab, "http://example.org/");
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
await promiseTabLoadEvent(gBrowser.selectedTab, "http://example.com/");
// Next load will remove the notification
this.complete = true;
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
await promiseTabLoadEvent(gBrowser.selectedTab, "http://example.org/");
},
onHidden(popup) {
Expand All @@ -108,6 +112,7 @@ var tests = [
this.oldSelectedTab = gBrowser.selectedTab;
await BrowserTestUtils.openNewForegroundTab(
gBrowser,
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com/"
);
this.notifyObj = new BasicNotification(this.id);
Expand All @@ -119,11 +124,14 @@ var tests = [
},
async onShown(popup) {
this.complete = false;
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
await promiseTabLoadEvent(gBrowser.selectedTab, "http://example.org/");
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
await promiseTabLoadEvent(gBrowser.selectedTab, "http://example.com/");
// Next load will hide the notification
this.notification.options.timeout = Date.now() - 1;
this.complete = true;
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
await promiseTabLoadEvent(gBrowser.selectedTab, "http://example.org/");
},
onHidden(popup) {
Expand All @@ -144,6 +152,7 @@ var tests = [
this.oldSelectedTab = gBrowser.selectedTab;
await BrowserTestUtils.openNewForegroundTab(
gBrowser,
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com/"
);
this.notifyObj = new BasicNotification(this.id);
Expand All @@ -155,7 +164,9 @@ var tests = [
async onShown(popup) {
this.complete = false;

// eslint-disable-next-line @microsoft/sdl/no-insecure-url
await promiseTabLoadEvent(gBrowser.selectedTab, "http://example.org/");
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
await promiseTabLoadEvent(gBrowser.selectedTab, "http://example.com/");
// Notification should persist across location changes
this.complete = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ var tests = [
this.oldSelectedTab = gBrowser.selectedTab;
await BrowserTestUtils.openNewForegroundTab(
gBrowser,
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com/"
);

Expand Down Expand Up @@ -198,6 +199,7 @@ var tests = [
{
id: "Test#6",
async run() {
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
await promiseTabLoadEvent(gBrowser.selectedTab, "http://example.com/");
let notifyObj = new BasicNotification(this.id);
notifyObj.options.eventCallback = function(eventName) {
Expand All @@ -219,6 +221,7 @@ var tests = [
let oldSelectedTab = gBrowser.selectedTab;
let newTab = await BrowserTestUtils.openNewForegroundTab(
gBrowser,
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com/"
);
gBrowser.selectedTab = oldSelectedTab;
Expand All @@ -245,10 +248,12 @@ var tests = [
{
id: "Test#8",
async run() {
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
await promiseTabLoadEvent(gBrowser.selectedTab, "http://example.com/");
let originalTab = gBrowser.selectedTab;
let bgTab = await BrowserTestUtils.openNewForegroundTab(
gBrowser,
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com/"
);
let anchor = document.createXULElement("box");
Expand Down Expand Up @@ -304,11 +309,13 @@ var tests = [

await Promise.all([
BrowserUtils.promiseObserved("window-global-created", wgp =>
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
wgp.documentURI.spec.startsWith("http://example.org/")
),
SpecialPowers.spawn(gBrowser.selectedBrowser, [], function() {
content.document
.getElementById("iframe")
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
.setAttribute("src", "http://example.org/");
}),
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ var tests = [
async run() {
await BrowserTestUtils.openNewForegroundTab(
gBrowser,
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com/"
);

Expand Down Expand Up @@ -157,6 +158,7 @@ var tests = [
async run() {
await BrowserTestUtils.openNewForegroundTab(
gBrowser,
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com/"
);
let notifyObj = new BasicNotification(this.id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ var tests = [
this.oldSelectedTab = gBrowser.selectedTab;
await BrowserTestUtils.openNewForegroundTab(
gBrowser,
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com/"
);
this.notifyObj = new BasicNotification(this.id);
Expand All @@ -104,7 +105,9 @@ var tests = [
async onShown(popup) {
this.complete = false;

// eslint-disable-next-line @microsoft/sdl/no-insecure-url
await promiseTabLoadEvent(gBrowser.selectedTab, "http://example.org/");
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
await promiseTabLoadEvent(gBrowser.selectedTab, "http://example.com/");

// This code should not be executed.
Expand All @@ -131,6 +134,7 @@ var tests = [
this.oldSelectedTab = gBrowser.selectedTab;
await BrowserTestUtils.openNewForegroundTab(
gBrowser,
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com/"
);
this.notifyObj = new BasicNotification(this.id);
Expand Down Expand Up @@ -174,6 +178,7 @@ var tests = [
this.oldSelectedTab = gBrowser.selectedTab;
await BrowserTestUtils.openNewForegroundTab(
gBrowser,
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com/"
);
},
Expand Down Expand Up @@ -212,12 +217,14 @@ var tests = [
this.oldSelectedTab = gBrowser.selectedTab;
await BrowserTestUtils.openNewForegroundTab(
gBrowser,
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com/"
);
let firstTab = gBrowser.selectedTab;

await BrowserTestUtils.openNewForegroundTab(
gBrowser,
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com/"
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ var tests = [
this.oldSelectedTab = gBrowser.selectedTab;
await BrowserTestUtils.openNewForegroundTab(
gBrowser,
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com/"
);

Expand Down Expand Up @@ -113,6 +114,7 @@ var tests = [
"geo anchor shouldn't be visible"
);

// eslint-disable-next-line @microsoft/sdl/no-insecure-url
await promiseTabLoadEvent(gBrowser.selectedTab, "http://example.com/");

isnot(
Expand Down Expand Up @@ -259,6 +261,7 @@ var tests = [
this.oldSelectedTab = gBrowser.selectedTab;
await BrowserTestUtils.openNewForegroundTab(
gBrowser,
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com/"
);
await hidden;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ add_task(
// Our initial tab will be A. Let's open two more tabs B and C, but keep
// A selected. Then, we'll trigger a PopupNotification in C, and then make
// it reshow.
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
let tabB = BrowserTestUtils.addTab(gBrowser, "http://example.com/");
await BrowserTestUtils.browserLoaded(tabB.linkedBrowser);

// eslint-disable-next-line @microsoft/sdl/no-insecure-url
let tabC = BrowserTestUtils.addTab(gBrowser, "http://example.com/");
await BrowserTestUtils.browserLoaded(tabC.linkedBrowser);

Expand Down
2 changes: 2 additions & 0 deletions browser/base/content/test/popupNotifications/head.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const PREF_SECURITY_DELAY_INITIAL = Services.prefs.getIntPref(
// tests to be run.
/* global tests */
function setup() {
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
BrowserTestUtils.openNewForegroundTab(gBrowser, "http://example.com/").then(
goNext
);
Expand Down Expand Up @@ -150,6 +151,7 @@ function BasicNotification(testId) {
},
];
this.options = {
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
name: "http://example.com",
eventCallback: eventName => {
switch (eventName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

const baseURL = getRootDirectory(gTestPath).replace(
"chrome://mochitests/content",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com"
);

Expand Down Expand Up @@ -89,9 +90,11 @@ async function test_opening_blocked_popups(testURL) {
}

add_task(async function() {
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
await test_opening_blocked_popups("http://example.com/");
});

add_task(async function() {
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
await test_opening_blocked_popups("http://w3c-test.org/");
});
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const { PermissionTestUtils } = ChromeUtils.import(

const baseURL = getRootDirectory(gTestPath).replace(
"chrome://mochitests/content",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com"
);
const URL = baseURL + "popup_blocker2.html";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,31 @@ requestLongerTimeout(2);

const testURL = getRootDirectory(gTestPath).replace(
"chrome://mochitests/content",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.org"
);

const examplecomURL = getRootDirectory(gTestPath).replace(
"chrome://mochitests/content",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com"
);

const w3cURL = getRootDirectory(gTestPath).replace(
"chrome://mochitests/content",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://w3c-test.org"
);

const examplenetURL = getRootDirectory(gTestPath).replace(
"chrome://mochitests/content",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.net"
);

const prefixexamplecomURL = getRootDirectory(gTestPath).replace(
"chrome://mochitests/content",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://prefixexample.com"
);

Expand Down
Loading

0 comments on commit a81ef17

Please sign in to comment.