Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 Eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
114 testThirdParty("foo", "bar", true, "different domain is third-party"); | 114 testThirdParty("foo", "bar", true, "different domain is third-party"); |
115 testThirdParty("foo.com", "foo.com", false, "same domain with TLD (.com) isn 't third-party"); | 115 testThirdParty("foo.com", "foo.com", false, "same domain with TLD (.com) isn 't third-party"); |
116 testThirdParty("foo.com", "bar.com", true, "same TLD (.com) but different do main is third-party"); | 116 testThirdParty("foo.com", "bar.com", true, "same TLD (.com) but different do main is third-party"); |
117 testThirdParty("foo.com", "www.foo.com", false, "same domain but differend s ubdomain isn't third-party"); | 117 testThirdParty("foo.com", "www.foo.com", false, "same domain but differend s ubdomain isn't third-party"); |
118 testThirdParty("foo.example.com", "bar.example.com", false, "same basedomain (example.com) isn't third-party"); | 118 testThirdParty("foo.example.com", "bar.example.com", false, "same basedomain (example.com) isn't third-party"); |
119 testThirdParty("foo.uk", "bar.uk", true, "same TLD (.uk) but different domai n is third-party"); | 119 testThirdParty("foo.uk", "bar.uk", true, "same TLD (.uk) but different domai n is third-party"); |
120 testThirdParty("foo.co.uk", "bar.co.uk", true, "same TLD (.co.uk) but differ ent domain is third-party"); | 120 testThirdParty("foo.co.uk", "bar.co.uk", true, "same TLD (.co.uk) but differ ent domain is third-party"); |
121 testThirdParty("foo.example.co.uk", "bar.example.co.uk", false, "same basedo main (example.co.uk) isn't third-party"); | 121 testThirdParty("foo.example.co.uk", "bar.example.co.uk", false, "same basedo main (example.co.uk) isn't third-party"); |
122 testThirdParty("1.2.3.4", "1.2.3.4", false, "same IPv4 address isn't third-p arty"); | 122 testThirdParty("1.2.3.4", "1.2.3.4", false, "same IPv4 address isn't third-p arty"); |
123 testThirdParty("1.1.1.1", "2.1.1.1", true, "different IPv4 address is third- party"); | 123 testThirdParty("1.1.1.1", "2.1.1.1", true, "different IPv4 address is third- party"); |
124 testThirdParty("0x01ff0101", "0x01ff0101", false, "same IPv4 hexadecimal add ress isn't third-party"); | |
125 testThirdParty("0x01ff0101", "0x01ff0102", true, "different IPv4 hexadecimal address is third-party"); | |
124 testThirdParty("1.0xff.3.4", "1.0xff.3.4", false, "same IPv4 address with he xadecimal octet isn't third-party"); | 126 testThirdParty("1.0xff.3.4", "1.0xff.3.4", false, "same IPv4 address with he xadecimal octet isn't third-party"); |
125 testThirdParty("1.0xff.1.1", "2.0xff.1.1", true, "different IPv4 address wit h hexadecimal octet is third-party"); | 127 testThirdParty("1.0xff.1.1", "2.0xff.1.1", true, "different IPv4 address wit h hexadecimal octet is third-party"); |
Wladimir Palant
2015/02/11 13:45:45
I guess we should test "0x01ff0101" as well.
Sebastian Noack
2015/02/11 17:07:06
Done.
| |
126 testThirdParty("0xff.example.com", "example.com", false, "domain starts like a hexadecimal IPv4 address but isn't one"); | 128 testThirdParty("0xff.example.com", "example.com", false, "domain starts like a hexadecimal IPv4 address but isn't one"); |
127 testThirdParty("[2001:db8:85a3::8a2e:370:7334]", "[2001:db8:85a3::8a2e:370:7 334]", false, "same IPv6 address isn't third-party"); | 129 testThirdParty("[2001:db8:85a3::8a2e:370:7334]", "[2001:db8:85a3::8a2e:370:7 334]", false, "same IPv6 address isn't third-party"); |
128 testThirdParty("[2001:db8:85a3::8a2e:370:7334]", "[5001:db8:85a3::8a2e:370:7 334]", true, "different IPv6 address is third-party"); | 130 testThirdParty("[2001:db8:85a3::8a2e:370:7334]", "[5001:db8:85a3::8a2e:370:7 334]", true, "different IPv6 address is third-party"); |
129 testThirdParty("[::ffff:192.0.2.128]", "[::ffff:192.0.2.128]", false, "same IPv4-mapped IPv6 address isn't third-party"); | 131 testThirdParty("[::ffff:192.0.2.128]", "[::ffff:192.0.2.128]", false, "same IPv4-mapped IPv6 address isn't third-party"); |
130 testThirdParty("[::ffff:192.0.2.128]", "[::ffff:192.1.2.128]", true, "differ ent IPv4-mapped IPv6 address is third-party"); | 132 testThirdParty("[::ffff:192.0.2.128]", "[::ffff:192.1.2.128]", true, "differ ent IPv4-mapped IPv6 address is third-party"); |
131 testThirdParty("xn--f-1gaa.com", "f\u00f6\u00f6.com", false, "same IDN isn't third-party"); | 133 testThirdParty("xn--f-1gaa.com", "f\u00f6\u00f6.com", false, "same IDN isn't third-party"); |
132 testThirdParty("example.com..", "example.com....", false, "traling dots are ignored"); | 134 testThirdParty("example.com..", "example.com....", false, "traling dots are ignored"); |
Wladimir Palant
2015/02/11 13:45:45
Interestingly, all browsers will indeed accept an
| |
133 }); | 135 }); |
134 })(); | 136 })(); |
LEFT | RIGHT |