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

Delta Between Two Patch Sets: test/filterClasses.js

Issue 29580558: Issue 5174 - Allow '{' and '}' in selectors (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Left Patch Set: adressed comments Created Oct. 18, 2017, 12:53 p.m.
Right Patch Set: Indent namespace content. Created Oct. 19, 2017, 12:48 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« compiled/filter/ElemHideBase.cpp ('K') | « compiled/filter/ElemHideBase.cpp ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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-present eyeo GmbH 3 * Copyright (C) 2006-present 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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 doTest(text.replace("##", "#@#"), selector, selectorDomain); 378 doTest(text.replace("##", "#@#"), selector, selectorDomain);
379 } 379 }
380 380
381 test.done(); 381 test.done();
382 }; 382 };
383 383
384 exports.testElemHideRulesWithBraces = function(test) 384 exports.testElemHideRulesWithBraces = function(test)
385 { 385 {
386 let filter = Filter.fromText("###foo{color: red}"); 386 let filter = Filter.fromText("###foo{color: red}");
387 test.equal(filter.type, "elemhide"); 387 test.equal(filter.type, "elemhide");
388 test.equal(filter.selector, "#foo\\x7B color: red\\x7D "); 388 test.equal(filter.selector, "#foo\\7B color: red\\7D ");
389 filter.delete(); 389 filter.delete();
390 390
391 filter = Filter.fromText("foo.com##[-abp-properties='/margin: [3-4]{2}/']"); 391 filter = Filter.fromText("foo.com##[-abp-properties='/margin: [3-4]{2}/']");
392 test.equal(filter.type, "elemhideemulation"); 392 test.equal(filter.type, "elemhideemulation");
393 test.equal(filter.selector, "[-abp-properties='/margin: [3-4]\\x7B 2\\x7D /']" ); 393 test.equal(filter.selector, "[-abp-properties='/margin: [3-4]\\7B 2\\7D /']");
394 filter.delete(); 394 filter.delete();
395 395
396 test.done(); 396 test.done();
397 }; 397 };
398 398
399 exports.testNotifications = function(test) 399 exports.testNotifications = function(test)
400 { 400 {
401 function checkNotifications(action, expected, message) 401 function checkNotifications(action, expected, message)
402 { 402 {
403 let result = null; 403 let result = null;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 filter.hitCount++; 446 filter.hitCount++;
447 }, ["filter.hitCount", "foobar"], "Increasing filter hit counts"); 447 }, ["filter.hitCount", "foobar"], "Increasing filter hit counts");
448 checkNotifications(() => 448 checkNotifications(() =>
449 { 449 {
450 filter.hitCount = 0; 450 filter.hitCount = 0;
451 }, ["filter.hitCount", "foobar"], "Resetting filter hit counts"); 451 }, ["filter.hitCount", "foobar"], "Resetting filter hit counts");
452 452
453 filter.delete(); 453 filter.delete();
454 test.done(); 454 test.done();
455 }; 455 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld