зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1783497 - Update LoginInfo related tests in passwordmgr for recent chrome url changes r=smaug,sfoster,credential-management-reviewers,sgalich
These tests expect `Service.io.newURI` raises exception when the given urls are chrome urls. Since we no longer raise exception for chrome url canonicalization failures, the tests need to be updated. Plus, this should be fine because even without the canonicalization changes, using a chrome url like "chrome://path/path/path" would raise exception too. Differential Revision: https://phabricator.services.mozilla.com/D159591
This commit is contained in:
Родитель
24bc14e326
Коммит
4b0b0f1f42
|
@ -36,7 +36,7 @@ nsLoginInfo.prototype = {
|
|||
displayOrigin = uri.displayHostPort || this.origin;
|
||||
} catch (ex) {
|
||||
// Fallback to this.origin set above in case a URI can't be contructed e.g.
|
||||
// chrome://FirefoxAccounts
|
||||
// file://
|
||||
}
|
||||
|
||||
if (this.httpRealm === null) {
|
||||
|
|
|
@ -15,10 +15,8 @@ add_task(function test_displayOrigin() {
|
|||
info(displayOrigin);
|
||||
Assert.equal(typeof displayOrigin, "string", "Check type");
|
||||
Assert.greater(displayOrigin.length, 0, "Check length");
|
||||
if (
|
||||
loginInfo.origin.startsWith("chrome://") ||
|
||||
loginInfo.origin.startsWith("file://")
|
||||
) {
|
||||
if (loginInfo.origin.startsWith("file://")) {
|
||||
// Fails to create the URL
|
||||
Assert.ok(displayOrigin.startsWith(loginInfo.origin), "Contains origin");
|
||||
} else {
|
||||
Assert.ok(
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
const TESTCASES = [
|
||||
["javascript:void(0);", null],
|
||||
["javascript:void(0);", "javascript:", true],
|
||||
["chrome://MyAccount", null],
|
||||
["chrome://MyAccount", "chrome://myaccount"],
|
||||
["data:text/html,example", null],
|
||||
[
|
||||
"http://username:password@example.com:80/foo?bar=baz#fragment",
|
||||
|
|
Загрузка…
Ссылка в новой задаче