Backed out changeset ce23fa9ffb16 (bug 479520)

This commit is contained in:
Carsten "Tomcat" Book 2015-10-28 12:29:13 +01:00
Родитель d059dd57dc
Коммит 7602d3a792
3 изменённых файлов: 14 добавлений и 33 удалений

Просмотреть файл

@ -92,14 +92,8 @@ function run_test() {
// www.1מיץ.com is invalid
expected_fail("www.1\u05DE\u05D9\u05E5.com");
// www.!מיץ.com is invalid
expected_fail("www.!\u05DE\u05D9\u05E5.com");
// www.מיץ!.com is invalid
expected_fail("www.\u05DE\u05D9\u05E5!.com");
// XXX TODO: add a test for an RTL label ending with a digit. This was
// invalid in IDNA2003 but became valid in IDNA2008
// www.מיץ1.com is invalid
expected_fail("www.\u05DE\u05D9\u05E51.com");
// But www.מיץ1פטל.com is fine
expected_pass("www.\u05DE\u05D9\u05E51\u05E4\u05D8\u05DC.com");
}

Просмотреть файл

@ -144,25 +144,19 @@ function run_test() {
} catch(e) {
result = ".com";
}
// If the punycode URL is equivalent to \ufffd.com (i.e. the
// blacklisted character has been replaced by a unicode
// REPLACEMENT CHARACTER, skip the test
if (result != "xn--zn7c.com") {
if (punycodeURL.substr(0, 4) == "xn--") {
// test convertToDisplayIDN with a Unicode URL and with a
// Punycode URL if we have one
do_check_eq(escape(result), escape(punycodeURL));
if (punycodeURL.substr(0, 4) == "xn--") {
// test convertToDisplayIDN with a Unicode URL and with a
// Punycode URL if we have one
equal(escape(result), escape(punycodeURL));
result = idnService.convertToDisplayIDN(punycodeURL, isASCII);
equal(escape(result), escape(punycodeURL));
} else {
// The "punycode" URL isn't punycode. This happens in testcases
// where the Unicode URL has become normalized to an ASCII URL,
// so, even though expectedUnicode is true, the expected result
// is equal to punycodeURL
equal(escape(result), escape(punycodeURL));
}
result = idnService.convertToDisplayIDN(punycodeURL, isASCII);
do_check_eq(escape(result), escape(punycodeURL));
} else {
// The "punycode" URL isn't punycode. This happens in testcases
// where the Unicode URL has become normalized to an ASCII URL,
// so, even though expectedUnicode is true, the expected result
// is equal to punycodeURL
do_check_eq(escape(result), escape(punycodeURL));
}
}
pbi.setBoolPref("network.IDN.whitelist.com", oldWhitelistCom);

Просмотреть файл

@ -12,15 +12,8 @@ const testcases = [
// non-XID character
["I♥NY", "xn--iny-zx5a", false, false, false],
/*
Behaviour of this test changed in IDNA2008, replacing the non-XID
character with U+FFFD replacement character - when all platforms use
IDNA2008 it can be uncommented and the punycode URL changed to
"xn--mgbl3eb85703a"
// new non-XID character in Unicode 6.3
["حلا\u061cل", "xn--bgbvr6gc", false, false, false],
*/
// U+30FB KATAKANA MIDDLE DOT is excluded from non-XID characters (bug 857490)
["乾燥肌・石けん", "xn--08j4gylj12hz80b0uhfup", false, true, true],