Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: qunit/tests/subscriptionInit.js

Issue 29805597: Issue 6699 - Support the "circumvention" filter list as default subscription (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Created June 13, 2018, 3:33 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« lib/subscriptionInit.js ('K') | « qunit/subscriptions.xml ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 "use strict";
19
20 {
21 let {chooseFilterSubscriptions} = require("../../lib/subscriptionInit");
22
23 QUnit.module("Subscription", {
24 setup()
25 {
26 let {Utils} = require("../../lib/utils");
27 Object.defineProperty(Utils, "appLocale", {value: "en", enumerable: true}) ;
28 },
29
30 teardown()
31 {
32 // TODO restore appLocale
33 }
34 });
35
36
37 test("Choosing filter subscriptions", assert =>
38 {
39 let done = assert.async();
40 fetch("subscriptions.xml")
41 .then(response => response.text())
Manish Jethani 2018/06/13 13:45:39 This appears not to be mentioned in the style guid
hub 2018/06/13 16:33:37 That's how it is done in `subscriptionInit.js`. Gi
Manish Jethani 2018/06/13 16:53:09 What I see in most places is this: func( pa
hub 2018/06/13 21:58:18 I just followed `lib/subscriptionInit.js:l202` Ot
Manish Jethani 2018/06/14 05:07:33 Acknowledged.
42 .then(text =>
43 {
44 let doc = new DOMParser().parseFromString(text, "application/xml");
45 let nodes = doc.getElementsByTagName("subscription");
46
47 let subs = chooseFilterSubscriptions(nodes);
48 assert.ok(subs);
49 assert.ok(subs.cv);
50 assert.ok(subs.ads);
51
52 assert.equal(subs.cv.getAttribute("prefixes"), "en");
53 assert.equal(subs.cv.getAttribute("type"), "cv");
54 assert.equal(subs.ads.getAttribute("prefixes"), "en");
55 assert.equal(subs.ads.getAttribute("type"), "ads");
56
57 done();
58 })
59 .catch(() =>
60 {
61 assert.ok(false);
62
63 done();
64 });
65 });
66 }
OLDNEW
« lib/subscriptionInit.js ('K') | « qunit/subscriptions.xml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld