diff --git a/toolkit/components/passwordmgr/test/unit/test_disabled_hosts.js b/toolkit/components/passwordmgr/test/unit/test_disabled_hosts.js index b49adbd5913c..4ec97be54ab2 100644 --- a/toolkit/components/passwordmgr/test/unit/test_disabled_hosts.js +++ b/toolkit/components/passwordmgr/test/unit/test_disabled_hosts.js @@ -143,55 +143,15 @@ add_task(function test_rememberSignons() }); /** - * Tests storing disabled hosts with non-ASCII characters where IDN is supported. + * Tests storing disabled hosts containing non-ASCII characters. */ -add_task(function* test_storage_setLoginSavingEnabled_nonascii_IDN_is_supported() +add_task(function* test_storage_setLoginSavingEnabled_nonascii() { - let hostname = "http://大.net"; - let encoding = "http://xn--pss.net"; - - // Test adding disabled host with nonascii URL (http://大.net). + let hostname = "http://" + String.fromCharCode(355) + ".example.com"; Services.logins.setLoginSavingEnabled(hostname, false); + yield* LoginTestUtils.reloadData(); - Assert.equal(Services.logins.getLoginSavingEnabled(hostname), false); - Assert.equal(Services.logins.getLoginSavingEnabled(encoding), false); - LoginTestUtils.assertDisabledHostsEqual(Services.logins.getAllDisabledHosts(), [hostname]); - - LoginTestUtils.clearData(); - - // Test adding disabled host with IDN ("http://xn--pss.net"). - Services.logins.setLoginSavingEnabled(encoding, false); - yield* LoginTestUtils.reloadData(); - Assert.equal(Services.logins.getLoginSavingEnabled(hostname), false); - Assert.equal(Services.logins.getLoginSavingEnabled(encoding), false); - LoginTestUtils.assertDisabledHostsEqual(Services.logins.getAllDisabledHosts(), [hostname]); - - LoginTestUtils.clearData(); -}); - -/** - * Tests storing disabled hosts with non-ASCII characters where IDN is not supported. - */ -add_task(function* test_storage_setLoginSavingEnabled_nonascii_IDN_not_supported() -{ - let hostname = "http://√.com"; - let encoding = "http://xn--19g.com"; - - // Test adding disabled host with nonascii URL (http://√.com). - Services.logins.setLoginSavingEnabled(hostname, false); - yield* LoginTestUtils.reloadData(); - Assert.equal(Services.logins.getLoginSavingEnabled(hostname), false); - Assert.equal(Services.logins.getLoginSavingEnabled(encoding), false); - LoginTestUtils.assertDisabledHostsEqual(Services.logins.getAllDisabledHosts(), [encoding]); - - LoginTestUtils.clearData(); - - // Test adding disabled host with IDN ("http://xn--19g.com"). - Services.logins.setLoginSavingEnabled(encoding, false); - yield* LoginTestUtils.reloadData(); - Assert.equal(Services.logins.getLoginSavingEnabled(hostname), false); - Assert.equal(Services.logins.getLoginSavingEnabled(encoding), false); - LoginTestUtils.assertDisabledHostsEqual(Services.logins.getAllDisabledHosts(), [encoding]); - + LoginTestUtils.assertDisabledHostsEqual(Services.logins.getAllDisabledHosts(), + [hostname]); LoginTestUtils.clearData(); });