Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test runs only with pattern: os != 'android'
- Manifest: toolkit/components/passwordmgr/test/unit/xpcshell.toml
/**
* Test for LoginHelper.getLoginOrigin
*/
"use strict";
const TESTCASES = [
["javascript:void(0);", null],
["javascript:void(0);", "javascript:", true],
["chrome://MyAccount", "chrome://myaccount"],
["data:text/html,example", null],
[
true,
],
["http://[::1]:80/foo", "http://[::1]"],
["http://127.0.0.1:8080/foo", "http://127.0.0.1:8080", true],
["https://[::1]:443/foo", "https://[::1]"],
[
],
[
],
["file:///foo/bar", "file://"],
["file://foo/bar", "file://"],
];
for (let [input, expected, allowJS] of TESTCASES) {
let actual = LoginHelper.getLoginOrigin(input, allowJS);
Assert.strictEqual(actual, expected, "Checking: " + input);
}