diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-14 21:49:04 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-14 21:49:04 +0200 |
commit | 39dac57259cff8b61db0b22cb2ad0a8adb02692e (patch) | |
tree | 52a026cc8c22793eb17fd0f5e22adce1ae08a1dd /toolkit/components/passwordmgr/test/unit/test_isOriginMatching.js | |
parent | a1cce3b2b00bbd9f4983013ddd8934a7bccb9e99 (diff) | |
parent | c2d9ab62f3d097c9e0e00184cab1f546554f5eaa (diff) | |
download | UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.tar UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.tar.gz UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.tar.lz UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.tar.xz UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.zip |
Merge branch 'redwood' into 28.9-platform
Diffstat (limited to 'toolkit/components/passwordmgr/test/unit/test_isOriginMatching.js')
-rw-r--r-- | toolkit/components/passwordmgr/test/unit/test_isOriginMatching.js | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/toolkit/components/passwordmgr/test/unit/test_isOriginMatching.js b/toolkit/components/passwordmgr/test/unit/test_isOriginMatching.js deleted file mode 100644 index 660910dff..000000000 --- a/toolkit/components/passwordmgr/test/unit/test_isOriginMatching.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Test LoginHelper.isOriginMatching - */ - -"use strict"; - -Cu.import("resource://gre/modules/LoginHelper.jsm"); - -add_task(function test_isOriginMatching() { - let testcases = [ - // Index 0 holds the expected return value followed by arguments to isOriginMatching. - [true, "http://example.com", "http://example.com"], - [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"], - [false, "http://example.com", "http://mozilla.org"], - [false, "http://example.com", "http://example.com:8080"], - [false, "https://example.com", "http://example.com"], - [false, "https://example.com", "https://mozilla.org"], - [false, "http://example.com", "http://sub.example.com"], - [false, "https://example.com", "https://sub.example.com"], - [false, "http://example.com", "https://example.com:8443"], - [false, "http://example.com:8080", "http://example.com:8081"], - [false, "http://example.com", ""], - [false, "", "http://example.com"], - [true, "http://example.com", "https://example.com", { schemeUpgrades: true }], - [true, "https://example.com", "https://example.com", { schemeUpgrades: true }], - [true, "http://example.com:8080", "http://example.com:8080", { schemeUpgrades: true }], - [true, "https://example.com:8443", "https://example.com:8443", { schemeUpgrades: true }], - [false, "https://example.com", "http://example.com", { schemeUpgrades: true }], // downgrade - [false, "http://example.com:8080", "https://example.com", { schemeUpgrades: true }], // port mismatch - [false, "http://example.com", "https://example.com:8443", { schemeUpgrades: true }], // port mismatch - [false, "http://sub.example.com", "http://example.com", { schemeUpgrades: true }], - ]; - for (let tc of testcases) { - let expected = tc.shift(); - Assert.strictEqual(LoginHelper.isOriginMatching(...tc), expected, - "Check " + JSON.stringify(tc)); - } -}); |