зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1569581 - Add unit tests for isOriginMatching with null/javascript: origins. r=jaws
Differential Revision: https://phabricator.services.mozilla.com/D43174 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
35e36fcef9
Коммит
56171aa00d
|
@ -11,6 +11,17 @@ add_task(function test_isOriginMatching() {
|
|||
[true, "http://example.com:8080", "http://example.com:8080"],
|
||||
[true, "https://example.com", "https://example.com"],
|
||||
[true, "https://example.com:8443", "https://example.com:8443"],
|
||||
|
||||
// The formActionOrigin can be "javascript:"
|
||||
[true, "javascript:", "javascript:"],
|
||||
[false, "javascript:", "http://example.com"],
|
||||
[false, "http://example.com", "javascript:"],
|
||||
|
||||
// HTTP Auth. logins have a null formActionOrigin
|
||||
[true, null, null],
|
||||
[false, null, "http://example.com"],
|
||||
[false, "http://example.com", null],
|
||||
|
||||
[false, "http://example.com", "http://mozilla.org"],
|
||||
[false, "http://example.com", "http://example.com:8080"],
|
||||
[false, "https://example.com", "http://example.com"],
|
||||
|
@ -142,6 +153,18 @@ add_task(function test_isOriginMatching() {
|
|||
"http://sub.example.mozilla.com",
|
||||
{ acceptDifferentSubdomains: false },
|
||||
],
|
||||
|
||||
// HTTP Auth. logins have a null formActionOrigin
|
||||
[
|
||||
false,
|
||||
null,
|
||||
"http://example.com",
|
||||
{
|
||||
acceptDifferentSubdomains: false,
|
||||
acceptWildcardMatch: true,
|
||||
schemeUpgrades: true,
|
||||
},
|
||||
],
|
||||
];
|
||||
for (let tc of testcases) {
|
||||
let expected = tc.shift();
|
||||
|
|
Загрузка…
Ссылка в новой задаче