From bc1e8585182b00d8745407d694701bbba6d3971b Mon Sep 17 00:00:00 2001 From: Artur Iunusov Date: Thu, 22 Feb 2024 10:13:18 +0000 Subject: [PATCH] Bug 1770944 - Fixed all test_permmanager_migrate.js tests, r=smaug Depends on D192626 Differential Revision: https://phabricator.services.mozilla.com/D192796 --- .../test/unit/test_permmanager_migrate_10-11.js | 2 +- .../permissions/test/unit/test_permmanager_migrate_4-7.js | 7 ++----- .../test/unit/test_permmanager_migrate_4-7_no_history.js | 6 ++---- .../permissions/test/unit/test_permmanager_migrate_5-7a.js | 7 ++----- .../permissions/test/unit/test_permmanager_migrate_5-7b.js | 1 - .../permissions/test/unit/test_permmanager_migrate_6-7a.js | 7 ++----- .../permissions/test/unit/test_permmanager_migrate_6-7b.js | 1 - .../permissions/test/unit/test_permmanager_migrate_7-8.js | 6 +++--- .../permissions/test/unit/test_permmanager_migrate_9-10.js | 2 +- 9 files changed, 13 insertions(+), 26 deletions(-) diff --git a/extensions/permissions/test/unit/test_permmanager_migrate_10-11.js b/extensions/permissions/test/unit/test_permmanager_migrate_10-11.js index c0d30865ee4c..78cb25ecb4b8 100644 --- a/extensions/permissions/test/unit/test_permmanager_migrate_10-11.js +++ b/extensions/permissions/test/unit/test_permmanager_migrate_10-11.js @@ -106,7 +106,7 @@ add_task(async function test() { ["https://foo.com", "storageAccessAPI^https://foo.com", 2, 0, 0, 0], ["http://foo.com", "storageAccessAPI^https://bar.com", 2, 0, 0, 0], ["http://foo.com", "storageAccessAPI^https://bar.com", 2, 0, 0, 0], - ["http://foo.com^inBrowser=1", "A", 2, 0, 0, 0], + ["http://foo.com", "A", 2, 0, 0, 0], ]; let found = expected.map(it => 0); diff --git a/extensions/permissions/test/unit/test_permmanager_migrate_4-7.js b/extensions/permissions/test/unit/test_permmanager_migrate_4-7.js index 857e0a462ceb..b212812fc255 100644 --- a/extensions/permissions/test/unit/test_permmanager_migrate_4-7.js +++ b/extensions/permissions/test/unit/test_permmanager_migrate_4-7.js @@ -144,7 +144,6 @@ add_task(async function test() { // The http:// entries under foo.com won't be inserted, as there are history entries for foo.com, // and http://foo.com or a subdomain are never visited. // ["http://foo.com", "A", 1, 0, 0], - // ["http://foo.com^inBrowser=1", "A", 1, 0, 0], // // Because we search for port/scheme combinations under eTLD+1, we should not have http:// entries // for subdomains of foo.com either @@ -153,15 +152,14 @@ add_task(async function test() { ["https://foo.com", "A", 1, 0, 0], ["https://foo.com", "C", 1, 0, 0], - ["https://foo.com^inBrowser=1", "A", 1, 0, 0], ["https://sub.foo.com", "B", 1, 0, 0], ["https://subber.sub.foo.com", "B", 1, 0, 0], // bar.ca will have both http:// and https:// for all entries, because there are no associated history entries ["http://bar.ca", "B", 1, 0, 0], ["https://bar.ca", "B", 1, 0, 0], - ["http://bar.ca^inBrowser=1", "A", 1, 0, 0], - ["https://bar.ca^inBrowser=1", "A", 1, 0, 0], + ["http://bar.ca", "A", 1, 0, 0], + ["https://bar.ca", "A", 1, 0, 0], ["file:///some/path/to/file.html", "A", 1, 0, 0], ["file:///another/file.html", "A", 1, 0, 0], @@ -169,7 +167,6 @@ add_task(async function test() { // also have these entries ["ftp://foo.com:8000", "A", 1, 0, 0], ["ftp://foo.com:8000", "C", 1, 0, 0], - ["ftp://foo.com:8000^inBrowser=1", "A", 1, 0, 0], // In addition, because we search for port/scheme combinations under eTLD+1, we should have the // following entries diff --git a/extensions/permissions/test/unit/test_permmanager_migrate_4-7_no_history.js b/extensions/permissions/test/unit/test_permmanager_migrate_4-7_no_history.js index ac40370a7e15..fffac5396260 100644 --- a/extensions/permissions/test/unit/test_permmanager_migrate_4-7_no_history.js +++ b/extensions/permissions/test/unit/test_permmanager_migrate_4-7_no_history.js @@ -178,21 +178,19 @@ add_task(function test() { let expected = [ ["http://foo.com", "A", 1, 0, 0], ["http://foo.com", "C", 1, 0, 0], - ["http://foo.com^inBrowser=1", "A", 1, 0, 0], ["http://sub.foo.com", "B", 1, 0, 0], ["http://subber.sub.foo.com", "B", 1, 0, 0], ["https://foo.com", "A", 1, 0, 0], ["https://foo.com", "C", 1, 0, 0], - ["https://foo.com^inBrowser=1", "A", 1, 0, 0], ["https://sub.foo.com", "B", 1, 0, 0], ["https://subber.sub.foo.com", "B", 1, 0, 0], // bar.ca will have both http:// and https:// for all entries, because there are no associated history entries ["http://bar.ca", "B", 1, 0, 0], ["https://bar.ca", "B", 1, 0, 0], - ["http://bar.ca^inBrowser=1", "A", 1, 0, 0], - ["https://bar.ca^inBrowser=1", "A", 1, 0, 0], + ["http://bar.ca", "A", 1, 0, 0], + ["https://bar.ca", "A", 1, 0, 0], ["file:///some/path/to/file.html", "A", 1, 0, 0], ["file:///another/file.html", "A", 1, 0, 0], diff --git a/extensions/permissions/test/unit/test_permmanager_migrate_5-7a.js b/extensions/permissions/test/unit/test_permmanager_migrate_5-7a.js index 8ea03d5e16a1..6891192eb657 100644 --- a/extensions/permissions/test/unit/test_permmanager_migrate_5-7a.js +++ b/extensions/permissions/test/unit/test_permmanager_migrate_5-7a.js @@ -211,7 +211,6 @@ add_task(async function test() { // The http:// entries under foo.com won't be inserted, as there are history entries for foo.com, // and http://foo.com or a subdomain are never visited. // ["http://foo.com", "A", 1, 0, 0], - // ["http://foo.com^inBrowser=1", "A", 1, 0, 0], // // Because we search for port/scheme combinations under eTLD+1, we should not have http:// entries // for subdomains of foo.com either @@ -220,15 +219,14 @@ add_task(async function test() { ["https://foo.com", "A", 1, 0, 0], ["https://foo.com", "C", 1, 0, 0], - ["https://foo.com^inBrowser=1", "A", 1, 0, 0], ["https://sub.foo.com", "B", 1, 0, 0], ["https://subber.sub.foo.com", "B", 1, 0, 0], // bar.ca will have both http:// and https:// for all entries, because there are no associated history entries ["http://bar.ca", "B", 1, 0, 0], ["https://bar.ca", "B", 1, 0, 0], - ["http://bar.ca^inBrowser=1", "A", 1, 0, 0], - ["https://bar.ca^inBrowser=1", "A", 1, 0, 0], + ["http://bar.ca", "A", 1, 0, 0], + ["https://bar.ca", "A", 1, 0, 0], ["file:///some/path/to/file.html", "A", 1, 0, 0], ["file:///another/file.html", "A", 1, 0, 0], @@ -236,7 +234,6 @@ add_task(async function test() { // also have these entries ["ftp://foo.com:8000", "A", 1, 0, 0], ["ftp://foo.com:8000", "C", 1, 0, 0], - ["ftp://foo.com:8000^inBrowser=1", "A", 1, 0, 0], // In addition, because we search for port/scheme combinations under eTLD+1, we should have the // following entries diff --git a/extensions/permissions/test/unit/test_permmanager_migrate_5-7b.js b/extensions/permissions/test/unit/test_permmanager_migrate_5-7b.js index 8c330effa9fc..5eabf2c22cef 100644 --- a/extensions/permissions/test/unit/test_permmanager_migrate_5-7b.js +++ b/extensions/permissions/test/unit/test_permmanager_migrate_5-7b.js @@ -102,7 +102,6 @@ add_task(function test() { let expected = [ ["https://foo.com", "A", 2, 0, 0, 0], ["http://foo.com", "A", 2, 0, 0, 0], - ["http://foo.com^inBrowser=1", "A", 2, 0, 0, 0], ["http://127.0.0.1", "B", 2, 0, 0, 0], ["http://localhost", "B", 2, 0, 0, 0], diff --git a/extensions/permissions/test/unit/test_permmanager_migrate_6-7a.js b/extensions/permissions/test/unit/test_permmanager_migrate_6-7a.js index 93b78e64784c..36eb8b4021ea 100644 --- a/extensions/permissions/test/unit/test_permmanager_migrate_6-7a.js +++ b/extensions/permissions/test/unit/test_permmanager_migrate_6-7a.js @@ -212,7 +212,6 @@ add_task(async function test() { // The http:// entries under foo.com won't be inserted, as there are history entries for foo.com, // and http://foo.com or a subdomain are never visited. // ["http://foo.com", "A", 1, 0, 0], - // ["http://foo.com^inBrowser=1", "A", 1, 0, 0], // // Because we search for port/scheme combinations under eTLD+1, we should not have http:// entries // for subdomains of foo.com either @@ -221,15 +220,14 @@ add_task(async function test() { ["https://foo.com", "A", 1, 0, 0], ["https://foo.com", "C", 1, 0, 0], - ["https://foo.com^inBrowser=1", "A", 1, 0, 0], ["https://sub.foo.com", "B", 1, 0, 0], ["https://subber.sub.foo.com", "B", 1, 0, 0], // bar.ca will have both http:// and https:// for all entries, because there are no associated history entries ["http://bar.ca", "B", 1, 0, 0], ["https://bar.ca", "B", 1, 0, 0], - ["http://bar.ca^inBrowser=1", "A", 1, 0, 0], - ["https://bar.ca^inBrowser=1", "A", 1, 0, 0], + ["http://bar.ca", "A", 1, 0, 0], + ["https://bar.ca", "A", 1, 0, 0], ["file:///some/path/to/file.html", "A", 1, 0, 0], ["file:///another/file.html", "A", 1, 0, 0], @@ -237,7 +235,6 @@ add_task(async function test() { // also have these entries ["ftp://foo.com:8000", "A", 1, 0, 0], ["ftp://foo.com:8000", "C", 1, 0, 0], - ["ftp://foo.com:8000^inBrowser=1", "A", 1, 0, 0], // In addition, because we search for port/scheme combinations under eTLD+1, we should have the // following entries diff --git a/extensions/permissions/test/unit/test_permmanager_migrate_6-7b.js b/extensions/permissions/test/unit/test_permmanager_migrate_6-7b.js index feed156d290c..ec99d70abaff 100644 --- a/extensions/permissions/test/unit/test_permmanager_migrate_6-7b.js +++ b/extensions/permissions/test/unit/test_permmanager_migrate_6-7b.js @@ -101,7 +101,6 @@ add_task(function test() { let expected = [ ["https://foo.com", "A", 2, 0, 0, 0], ["http://foo.com", "A", 2, 0, 0, 0], - ["http://foo.com^inBrowser=1", "A", 2, 0, 0, 0], ]; let found = expected.map(it => 0); diff --git a/extensions/permissions/test/unit/test_permmanager_migrate_7-8.js b/extensions/permissions/test/unit/test_permmanager_migrate_7-8.js index cd8b0f86ccf6..df2c6d975aa4 100644 --- a/extensions/permissions/test/unit/test_permmanager_migrate_7-8.js +++ b/extensions/permissions/test/unit/test_permmanager_migrate_7-8.js @@ -164,7 +164,7 @@ add_task(async function test() { let created7 = [ insertOrigin("https://foo.com", "A", 2, 0, 0, 0), insertOrigin("http://foo.com", "A", 2, 0, 0, 0), - insertOrigin("http://foo.com^inBrowser=1", "A", 2, 0, 0, 0), + insertOrigin("http://foo.com^inBrowser=1", "C", 2, 0, 0, 0), insertOrigin("https://192.0.2.235", "A", 2, 0, 0), ]; @@ -174,7 +174,7 @@ add_task(async function test() { insertHost("foo.com", "A", 1, 0, 0, 0, 0, false), insertHost("foo.com", "C", 1, 0, 0, 0, 0, false), insertHost("foo.com", "A", 1, 0, 0, 0, 1000, false), - insertHost("foo.com", "A", 1, 0, 0, 0, 2000, true), + insertHost("foo.com", "C", 1, 0, 0, 0, 2000, true), insertHost("sub.foo.com", "B", 1, 0, 0, 0, 0, false), insertHost("subber.sub.foo.com", "B", 1, 0, 0, 0, 0, false), insertHost("bar.ca", "B", 1, 0, 0, 0, 0, false), @@ -224,7 +224,7 @@ add_task(async function test() { // We should have kept the previously migrated entries ["https://foo.com", "A", 2, 0, 0, 0], ["http://foo.com", "A", 2, 0, 0, 0], - ["http://foo.com^inBrowser=1", "A", 2, 0, 0, 0], + ["http://foo.com", "C", 2, 0, 0, 0], // Make sure that we also support localhost, and IP addresses ["https://localhost:8080", "A", 1, 0, 0], diff --git a/extensions/permissions/test/unit/test_permmanager_migrate_9-10.js b/extensions/permissions/test/unit/test_permmanager_migrate_9-10.js index 02aa3bb4678f..5a02d143d552 100644 --- a/extensions/permissions/test/unit/test_permmanager_migrate_9-10.js +++ b/extensions/permissions/test/unit/test_permmanager_migrate_9-10.js @@ -172,7 +172,7 @@ add_task(async function test() { let expected = [ ["https://foo.com", "A", 2, 0, 0, 0], ["http://foo.com", "A", 2, 0, 0, 0], - ["http://foo.com^inBrowser=1", "A", 2, 0, 0, 0], + ["http://foo.com", "A", 2, 0, 0, 0], ]; let found = expected.map(it => 0);