Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

/**
* Test for LoginHelper.getLoginOrigin
*/
"use strict";
const TESTCASES = [
["javascript:void(0);", null],
["javascript:void(0);", "javascript:", true],
["data:text/html,example", null],
[
true,
],
[
],
[
],
["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);
}