Bug 1801843 - Add disable next line for all docshell/test/browser r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D162713
This commit is contained in:
lyavor 2022-12-08 12:41:59 +00:00
Родитель c4144b4985
Коммит eb81c040db
29 изменённых файлов: 50 добавлений и 28 удалений

Просмотреть файл

@ -1432,34 +1432,6 @@ module.exports = {
"devtools/shared/commands/resource/tests/browser_resources_sources.js",
"devtools/shared/commands/target/tests/browser_target_command_bfcache.js",
"devtools/shared/test-helpers/browser_allocation_tracker.js",
"docshell/test/browser/browser_alternate_fixup_middle_click_link.js",
"docshell/test/browser/browser_backforward_restore_scroll.js",
"docshell/test/browser/browser_browsingContext-01.js",
"docshell/test/browser/browser_browsingContext-02.js",
"docshell/test/browser/browser_browsingContext-getAllBrowsingContextsInSubtree.js",
"docshell/test/browser/browser_browsingContext-webProgress.js",
"docshell/test/browser/browser_browsing_context_attached.js",
"docshell/test/browser/browser_bug1206879.js",
"docshell/test/browser/browser_bug1415918_beforeunload_options.js",
"docshell/test/browser/browser_bug1622420.js",
"docshell/test/browser/browser_bug1673702.js",
"docshell/test/browser/browser_bug1674464.js",
"docshell/test/browser/browser_bug1691153.js",
"docshell/test/browser/browser_bug422543.js",
"docshell/test/browser/browser_bug554155.js",
"docshell/test/browser/browser_bug655273.js",
"docshell/test/browser/browser_cross_process_csp_inheritance.js",
"docshell/test/browser/browser_csp_uir.js",
"docshell/test/browser/browser_dataURI_unique_opaque_origin.js",
"docshell/test/browser/browser_data_load_inherit_csp.js",
"docshell/test/browser/browser_fall_back_to_https.js",
"docshell/test/browser/browser_fission_maxOrigins.js",
"docshell/test/browser/browser_history_triggeringprincipal_viewsource.js",
"docshell/test/browser/browser_isInitialDocument.js",
"docshell/test/browser/browser_multiple_pushState.js",
"docshell/test/browser/browser_onunload_stop.js",
"docshell/test/browser/browser_uriFixupAlternateRedirects.js",
"docshell/test/browser/redirect_to_example.sjs",
"docshell/test/chrome/bug113934_window.xhtml",
"docshell/test/chrome/bug449778_window.xhtml",
"docshell/test/chrome/bug449780_window.xhtml",

Просмотреть файл

@ -11,6 +11,7 @@ add_task(async function test_alt_fixup_middle_click() {
await BrowserTestUtils.withNewTab("about:blank", async browser => {
await SpecialPowers.spawn(browser, [], () => {
let link = content.document.createElement("a");
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
link.href = "http://example/foo";
link.textContent = "Me, me, click me!";
content.document.body.append(link);
@ -42,6 +43,7 @@ add_task(async function test_alt_fixup_middle_click() {
// well be meaningful:
is(
tab.linkedBrowser.currentURI.spec,
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example/foo",
"URL for tab should be correct."
);

Просмотреть файл

@ -8,6 +8,7 @@ const ROOT = getRootDirectory(gTestPath).replace(
"http://mochi.test:8888"
);
const URL1 = ROOT + "file_backforward_restore_scroll.html";
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
const URL2 = "http://example.net/";
const SCROLL0 = 500;

Просмотреть файл

@ -121,12 +121,14 @@ add_task(async function() {
url:
getRootDirectory(gTestPath).replace(
"chrome://mochitests/content",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com"
) + "dummy_page.html",
},
async function(browser) {
let path = getRootDirectory(gTestPath).replace(
"chrome://mochitests/content",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com"
);
await SpecialPowers.spawn(browser, [path], async function(path) {

Просмотреть файл

@ -9,10 +9,12 @@ add_task(async function() {
async function(browser) {
const BASE1 = getRootDirectory(gTestPath).replace(
"chrome://mochitests/content",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com"
);
const BASE2 = getRootDirectory(gTestPath).replace(
"chrome://mochitests/content",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://test1.example.com"
);
const URL = BASE1 + "onload_message.html";

Просмотреть файл

@ -20,6 +20,7 @@ add_task(async function() {
// Add 15 example.com frames to the toplevel document.
let frames = await Promise.all(
Array.from({ length: 15 }).map(_ =>
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
SpecialPowers.spawn(browser, ["http://example.com/"], addFrame)
)
);
@ -27,6 +28,7 @@ add_task(async function() {
// Add an example.org subframe to each example.com frame.
let subframes = await Promise.all(
Array.from({ length: 15 }).map((_, i) =>
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
SpecialPowers.spawn(frames[i], ["http://example.org/"], addFrame)
)
);

Просмотреть файл

@ -106,6 +106,7 @@ add_task(async function() {
const onSecondLocationChanged = waitForNextLocationChange(webProgress);
const onSecondPageDocumentStart = waitForNextDocumentStart(webProgress);
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
const secondLocation = "http://example.com/document-builder.sjs?html=com";
loaded = BrowserTestUtils.browserLoaded(browser);
BrowserTestUtils.loadURI(browser, secondLocation);

Просмотреть файл

@ -3,6 +3,7 @@
const TEST_PATH =
getRootDirectory(gTestPath).replace(
"chrome://mochitests/content",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com"
) + "dummy_page.html";

Просмотреть файл

@ -2,6 +2,7 @@ add_task(async function() {
let url =
getRootDirectory(gTestPath).replace(
"chrome://mochitests/content/",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com/"
) + "file_bug1206879.html";
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, url, true);

Просмотреть файл

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

Просмотреть файл

@ -17,6 +17,7 @@ add_task(async function test() {
let tab = await BrowserTestUtils.openNewForegroundTab(
gBrowser,
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.org/browser/docshell/test/browser/file_bug1622420.html"
);
let childBC = tab.linkedBrowser.browsingContext.children[0];

Просмотреть файл

@ -1,6 +1,8 @@
const DUMMY =
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.org/browser/docshell/test/browser/dummy_page.html";
const JSON =
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com/browser/docshell/test/browser/file_bug1673702.json";
add_task(async function test_backAndReload() {

Просмотреть файл

@ -1,6 +1,8 @@
const DUMMY_1 =
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.org/browser/docshell/test/browser/dummy_page.html";
const DUMMY_2 =
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com/browser/docshell/test/browser/dummy_page.html";
add_task(async function test_backAndReload() {

Просмотреть файл

@ -3,6 +3,7 @@
add_task(async () => {
const TEST_PATH = getRootDirectory(gTestPath).replace(
"chrome://mochitests/content",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com"
);

Просмотреть файл

@ -17,6 +17,7 @@ add_task(async function runTests() {
// Check if all history listeners are always notified.
info("# part 1");
await whenPageShown(browser, () =>
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
BrowserTestUtils.loadURI(browser, "http://www.example.com/")
);
await checkListenersAsync("newentry", "shistory has a new entry");
@ -119,6 +120,7 @@ add_task(async function runTests() {
// Check if all history listeners are always notified.
info("# part 1");
await whenPageShown(browser, () =>
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
BrowserTestUtils.loadURI(browser, "http://www.example.com/")
);
checkListeners("newentry", "shistory has a new entry");

Просмотреть файл

@ -1,5 +1,6 @@
add_task(async function test() {
await BrowserTestUtils.withNewTab(
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
{ gBrowser, url: "http://example.com" },
async function(browser) {
let numLocationChanges = 0;

Просмотреть файл

@ -12,6 +12,7 @@ add_task(async function test() {
waitForExplicitFinish();
await BrowserTestUtils.withNewTab(
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
{ gBrowser, url: "http://example.com" },
async function(browser) {
if (!SpecialPowers.Services.appinfo.sessionHistoryInParent) {

Просмотреть файл

@ -5,6 +5,7 @@
const TEST_PATH = getRootDirectory(gTestPath).replace(
"chrome://mochitests/content",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com"
);
const TEST_URI = TEST_PATH + "file_cross_process_csp_inheritance.html";

Просмотреть файл

@ -2,10 +2,12 @@
const TEST_PATH = getRootDirectory(gTestPath).replace(
"chrome://mochitests/content",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com"
);
const TEST_URI = TEST_PATH + "file_csp_uir.html"; // important to be http: to test upgrade-insecure-requests
const RESULT_URI =
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
TEST_PATH.replace("http://", "https://") + "file_csp_uir_dummy.html";
function verifyCSP(aTestName, aBrowser, aResultURI) {

Просмотреть файл

@ -1,4 +1,5 @@
add_task(async function test_dataURI_unique_opaque_origin() {
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
let tab = BrowserTestUtils.addTab(gBrowser, "http://example.com");
let browser = tab.linkedBrowser;
await BrowserTestUtils.browserLoaded(browser);

Просмотреть файл

@ -2,6 +2,7 @@
const TEST_PATH = getRootDirectory(gTestPath).replace(
"chrome://mochitests/content",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com"
);
const HTML_URI = TEST_PATH + "file_data_load_inherit_csp.html";

Просмотреть файл

@ -24,6 +24,7 @@ const { UrlbarTestUtils } = ChromeUtils.importESModule(
const bug1002724_tests = [
{
original: "example.com",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
expected: "http://example.com",
explanation: "Should load HTTP version of example.com",
},

Просмотреть файл

@ -27,14 +27,23 @@ const PREF_LAST_DISQUALIFIED =
"fission.experiment.max-origins.last-disqualified";
const SITE_ORIGINS = [
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com/",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.org/",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.net/",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.tw/",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.cn/",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.fi/",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.in/",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.lk/",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://w3c-test.org/",
"https://www.mozilla.org/",
];

Просмотреть файл

@ -2,6 +2,7 @@
const TEST_PATH = getRootDirectory(gTestPath).replace(
"chrome://mochitests/content",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com"
);
const HTML_URI = TEST_PATH + "dummy_page.html";

Просмотреть файл

@ -29,6 +29,7 @@ add_task(async function new_about_blank_tab() {
add_task(async function iframe_initial_about_blank() {
await BrowserTestUtils.withNewTab(
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com/document-builder.sjs?html=com",
async browser => {
info("Create an iframe without any explicit location");
@ -83,6 +84,7 @@ add_task(async function iframe_initial_about_blank() {
await new Promise(resolve => {
iframe.addEventListener("load", resolve, { once: true });
iframe.src =
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.org/document-builder.sjs?html=org-iframe";
content.document.body.appendChild(iframe);
});
@ -163,11 +165,13 @@ add_task(async function window_open() {
}
await BrowserTestUtils.withNewTab(
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com/document-builder.sjs?html=com",
async browser => {
info("Use window.open() with cross-origin document");
await testWindowOpen({
browser,
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
args: ["http://example.org/document-builder.sjs?html=org-popup"],
isCrossOrigin: true,
willLoad: true,
@ -176,6 +180,7 @@ add_task(async function window_open() {
info("Use window.open() with same-origin document");
await testWindowOpen({
browser,
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
args: ["http://example.com/document-builder.sjs?html=com-popup"],
isCrossOrigin: false,
willLoad: true,
@ -202,6 +207,7 @@ add_task(async function window_open() {
add_task(async function document_open() {
await BrowserTestUtils.withNewTab(
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com/document-builder.sjs?html=com",
async browser => {
is(browser.browsingContext.currentWindowGlobal.isInitialDocument, false);

Просмотреть файл

@ -3,9 +3,11 @@ add_task(async function test_multiple_pushState() {
{
gBrowser,
url:
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.org/browser/docshell/test/browser/file_multiple_pushState.html",
},
async function(browser) {
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
const kExpected = "http://example.org/bar/ABC/DEF?key=baz";
let contentLocation = await SpecialPowers.spawn(

Просмотреть файл

@ -7,6 +7,7 @@ const TEST_PAGE_1 =
"http://mochi.test:8888/browser/docshell/test/browser/dummy_page.html";
const TEST_PAGE_2 =
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://example.com/browser/docshell/test/browser/dummy_page.html";
add_task(async function test() {

Просмотреть файл

@ -5,6 +5,7 @@ const { UrlbarTestUtils } = ChromeUtils.importESModule(
);
const REDIRECTURL =
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://www.example.com/browser/docshell/test/browser/redirect_to_example.sjs";
add_task(async function() {

Просмотреть файл

@ -1,4 +1,5 @@
function handleRequest(request, response) {
response.setStatusLine(request.httpVersion, 302, "Moved Permanently");
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
response.setHeader("Location", "http://example");
}