зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1856298 - Enable ESLint rule @microsoft/sdl/no-insecure-url for all of browser/components/search. r=search-reviewers,daleharvey
Differential Revision: https://phabricator.services.mozilla.com/D189748
This commit is contained in:
Родитель
4fb745dae5
Коммит
2a8febb3d8
|
@ -916,12 +916,6 @@ module.exports = {
|
|||
"browser/components/safebrowsing/content/test/browser_bug415846.js",
|
||||
"browser/components/safebrowsing/content/test/browser_whitelisted.js",
|
||||
"browser/components/screenshots/tests/browser/head.js",
|
||||
"browser/components/search/test/browser/browser_483086.js",
|
||||
"browser/components/search/test/browser/browser_addKeywordSearch.js",
|
||||
"browser/components/search/test/browser/browser_ime_composition.js",
|
||||
"browser/components/search/test/browser/browser_search_discovery.js",
|
||||
"browser/components/search/test/browser/browser_search_telemetry_searchbar.js",
|
||||
"browser/components/search/test/browser/browser_search_telemetry_sources_ads.js",
|
||||
"browser/components/sessionstore/test/browser_1284886_suspend_tab.js",
|
||||
"browser/components/sessionstore/test/browser_394759_behavior.js",
|
||||
"browser/components/sessionstore/test/browser_394759_purge.js",
|
||||
|
|
|
@ -6,5 +6,5 @@
|
|||
<Url type="text/html" method="GET" template="http://mochi.test:8888/browser/browser/components/search/test/browser/?search">
|
||||
<Param name="test" value="{searchTerms}"/>
|
||||
</Url>
|
||||
<moz:SearchForm>http://example.com</moz:SearchForm>
|
||||
<moz:SearchForm>https://example.com</moz:SearchForm>
|
||||
</OpenSearchDescription>
|
||||
|
|
|
@ -38,7 +38,7 @@ function test2() {
|
|||
case "engine-added":
|
||||
let engine = gSS.getEngineByName("483086b");
|
||||
ok(engine, "Test engine 2 installed");
|
||||
is(engine.searchForm, "http://example.com", "SearchForm is correct");
|
||||
is(engine.searchForm, "https://example.com", "SearchForm is correct");
|
||||
gSS.removeEngine(engine);
|
||||
break;
|
||||
case "engine-removed":
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
var testData = [
|
||||
{ desc: "No path", action: "http://example.com/", param: "q" },
|
||||
{ desc: "No path", action: "https://example.com/", param: "q" },
|
||||
{
|
||||
desc: "With path",
|
||||
action: "http://example.com/new-path-here/",
|
||||
action: "https://example.com/new-path-here/",
|
||||
param: "q",
|
||||
},
|
||||
{ desc: "No action", action: "", param: "q" },
|
||||
{
|
||||
desc: "With Query String",
|
||||
action: "http://example.com/search?oe=utf-8",
|
||||
action: "https://example.com/search?oe=utf-8",
|
||||
param: "q",
|
||||
},
|
||||
{
|
||||
desc: "With Unicode Query String",
|
||||
action: "http://example.com/searching",
|
||||
action: "https://example.com/searching",
|
||||
param: "q",
|
||||
testHiddenUnicode: true,
|
||||
},
|
||||
|
@ -21,7 +21,7 @@ var testData = [
|
|||
|
||||
add_task(async function () {
|
||||
const TEST_URL =
|
||||
"http://example.org/browser/browser/components/search/test/browser/test.html";
|
||||
"https://example.org/browser/browser/components/search/test/browser/test.html";
|
||||
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_URL);
|
||||
|
||||
let count = 0;
|
||||
|
|
|
@ -15,7 +15,7 @@ add_setup(async function () {
|
|||
|
||||
add_task(async function test_composition_with_focus() {
|
||||
info("Open a page");
|
||||
await BrowserTestUtils.openNewForegroundTab(gBrowser, "http://example.com");
|
||||
await BrowserTestUtils.openNewForegroundTab(gBrowser, "https://example.com");
|
||||
|
||||
info("Focus on the search bar");
|
||||
const searchBarTextBox = BrowserSearch.searchBar.textbox;
|
||||
|
|
|
@ -73,7 +73,7 @@ async function searchDiscovery() {
|
|||
let head = doc.getElementById("linkparent");
|
||||
let link = doc.createElement("link");
|
||||
link.rel = test.rel || "search";
|
||||
link.href = test.href || "http://so.not.here.mozilla.com/search.xml";
|
||||
link.href = test.href || "https://so.not.here.mozilla.com/search.xml";
|
||||
link.type = test.type || "application/opensearchdescription+xml";
|
||||
link.title = test.title;
|
||||
head.appendChild(link);
|
||||
|
@ -101,7 +101,7 @@ async function searchDiscovery() {
|
|||
gBrowser.selectedBrowser,
|
||||
"DOMLinkAdded",
|
||||
false,
|
||||
e => e.target.href == "http://second.mozilla.com/search.xml",
|
||||
e => e.target.href == "https://second.mozilla.com/search.xml",
|
||||
true
|
||||
);
|
||||
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], () => {
|
||||
|
@ -109,11 +109,11 @@ async function searchDiscovery() {
|
|||
let head = doc.getElementById("linkparent");
|
||||
let link = doc.createElement("link");
|
||||
link.rel = "search";
|
||||
link.href = "http://first.mozilla.com/search.xml";
|
||||
link.href = "https://first.mozilla.com/search.xml";
|
||||
link.type = "application/opensearchdescription+xml";
|
||||
link.title = "Test Engine";
|
||||
let link2 = link.cloneNode(false);
|
||||
link2.href = "http://second.mozilla.com/search.xml";
|
||||
link2.href = "https://second.mozilla.com/search.xml";
|
||||
head.appendChild(link);
|
||||
head.appendChild(link2);
|
||||
});
|
||||
|
@ -125,7 +125,7 @@ async function searchDiscovery() {
|
|||
is(browser.engines.length, 1, "only one engine");
|
||||
is(
|
||||
browser.engines[0].uri,
|
||||
"http://first.mozilla.com/search.xml",
|
||||
"https://first.mozilla.com/search.xml",
|
||||
"first engine wins"
|
||||
);
|
||||
browser.engines = null;
|
||||
|
|
Загрузка…
Ссылка в новой задаче