Bug 1931425 - Limit how often moz-label's #setStyles runs r=reusable-components-revie...
[gecko.git] / netwerk / test / unit / test_tldservice_nextsubdomain.js
blob5a078aa80957ef989fbeceb473155d56d1c0ac85
1 "use strict";
3 function run_test() {
4 var tests = [
5 { data: "bar.foo.co.uk", result: "foo.co.uk" },
6 { data: "foo.bar.foo.co.uk", result: "bar.foo.co.uk" },
7 { data: "foo.co.uk", throw: true },
8 { data: "co.uk", throw: true },
9 { data: ".co.uk", throw: true },
10 { data: "com", throw: true },
11 { data: "tûlîp.foo.fr", result: "foo.fr" },
12 { data: "tûlîp.fôû.fr", result: "xn--f-xgav.fr" },
13 { data: "file://foo/bar", throw: true },
16 tests.forEach(function (test) {
17 try {
18 var r = Services.eTLD.getNextSubDomain(test.data);
19 Assert.equal(r, test.result);
20 } catch (e) {
21 Assert.ok(test.throw);
23 });