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

Side by Side Diff: test/notification.js

Issue 29501607: Issue 5459 - Add support to show a notification based on the number of ads blocked (Closed)
Patch Set: Addressed review comments Created Aug. 24, 2017, 4:28 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/notification.js ('k') | test/stub-modules/prefs.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 ["platform", "chromium", true], 167 ["platform", "chromium", true],
168 ["platform", "gecko", false], 168 ["platform", "gecko", false],
169 ["platformMinVersion", "12.0", true], 169 ["platformMinVersion", "12.0", true],
170 ["platformMinVersion", "12", true], 170 ["platformMinVersion", "12", true],
171 ["platformMinVersion", "11", true], 171 ["platformMinVersion", "11", true],
172 ["platformMinVersion", "13", false], 172 ["platformMinVersion", "13", false],
173 ["platformMinVersion", "12.1", false], 173 ["platformMinVersion", "12.1", false],
174 ["platformMaxVersion", "12.0", true], 174 ["platformMaxVersion", "12.0", true],
175 ["platformMaxVersion", "12", true], 175 ["platformMaxVersion", "12", true],
176 ["platformMaxVersion", "13", true], 176 ["platformMaxVersion", "13", true],
177 ["platformMaxVersion", "11", false] 177 ["platformMaxVersion", "11", false],
178 ["blockedTotalMin", "11", false],
179 ["blockedTotalMin", "10", true],
180 ["blockedTotalMax", "10", true],
181 ["blockedTotalMax", "1", false],
182 ["locales", ["en-US"], true],
183 ["locales", ["en-US", "de-DE"], true],
184 ["locales", ["de-DE"], false],
185 ["locales", ["en-GB", "de-DE"], false]
178 ]) 186 ])
179 { 187 {
180 exports.testTargetSelection[`${propName}=${value}`] = function(test) 188 exports.testTargetSelection[`${propName}=${value}`] = function(test)
181 { 189 {
182 let targetInfo = {}; 190 let targetInfo = {};
183 targetInfo[propName] = value; 191 targetInfo[propName] = value;
184 192
185 let information = { 193 let information = {
186 id: 1, 194 id: 1,
187 type: "information", 195 type: "information",
(...skipping 18 matching lines...) Expand all
206 ["extension", "adblockplus", false], 214 ["extension", "adblockplus", false],
207 ["extensionMinVersion", "1.4", true], 215 ["extensionMinVersion", "1.4", true],
208 ["extensionMinVersion", "1.5", false], 216 ["extensionMinVersion", "1.5", false],
209 ["application", "chrome", true], 217 ["application", "chrome", true],
210 ["application", "firefox", false], 218 ["application", "firefox", false],
211 ["applicationMinVersion", "27", true], 219 ["applicationMinVersion", "27", true],
212 ["applicationMinVersion", "28", false], 220 ["applicationMinVersion", "28", false],
213 ["platform", "chromium", true], 221 ["platform", "chromium", true],
214 ["platform", "gecko", false], 222 ["platform", "gecko", false],
215 ["platformMinVersion", "12", true], 223 ["platformMinVersion", "12", true],
216 ["platformMinVersion", "13", false] 224 ["platformMinVersion", "13", false],
225 ["unkown", "unknown", false]
217 ])) 226 ]))
218 { 227 {
219 exports.testMultipleTargets[`${propName1}=${value1},${propName2}=${value2}`] = function(test) 228 exports.testMultipleTargets[`${propName1}=${value1},${propName2}=${value2}`] = function(test)
220 { 229 {
221 let targetInfo1 = {}; 230 let targetInfo1 = {};
222 targetInfo1[propName1] = value1; 231 targetInfo1[propName1] = value1;
223 let targetInfo2 = {}; 232 let targetInfo2 = {};
224 targetInfo2[propName2] = value2; 233 targetInfo2[propName2] = value2;
225 234
226 let information = { 235 let information = {
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 test.done(); 524 test.done();
516 }; 525 };
517 526
518 exports.testMissingTranslation = function(test) 527 exports.testMissingTranslation = function(test)
519 { 528 {
520 let notification = {message: {"en-US": "en-US"}}; 529 let notification = {message: {"en-US": "en-US"}};
521 let texts = Notification.getLocalizedTexts(notification, "fr"); 530 let texts = Notification.getLocalizedTexts(notification, "fr");
522 test.equal(texts.message, "en-US"); 531 test.equal(texts.message, "en-US");
523 test.done(); 532 test.done();
524 }; 533 };
OLDNEW
« no previous file with comments | « lib/notification.js ('k') | test/stub-modules/prefs.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld