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

Side by Side Diff: test/filterClasses.js

Issue 29909555: Issue 7046 - Defer caching of domain maps (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Update JSDoc Created Oct. 13, 2018, 11:41 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
« lib/filterClasses.js ('K') | « lib/filterClasses.js ('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
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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 test.equal( 598 test.equal(
599 filterStrip.rewriteUrl("http://example.com/?tag"), 599 filterStrip.rewriteUrl("http://example.com/?tag"),
600 "http://example.com/?" 600 "http://example.com/?"
601 ); 601 );
602 602
603 test.done(); 603 test.done();
604 }; 604 };
605 605
606 exports.testDomainMapDeduplication = function(test) 606 exports.testDomainMapDeduplication = function(test)
607 { 607 {
608 // Make sure the generated domain map is cached on first access.
Manish Jethani 2018/10/15 15:36:59 We need to set this in order to test our deduplica
609 ActiveFilter.prototype._domainsAccessCacheThreshold = 0;
610
608 let filter1 = Filter.fromText("example.com##.foo"); 611 let filter1 = Filter.fromText("example.com##.foo");
609 let filter2 = Filter.fromText("example.com##.bar"); 612 let filter2 = Filter.fromText("example.com##.bar");
610 613
611 // This compares the references to make sure that both refer to the same 614 // This compares the references to make sure that both refer to the same
612 // object (#6815). 615 // object (#6815).
613 test.equal(filter1.domains, filter2.domains); 616 test.equal(filter1.domains, filter2.domains);
614 617
615 let filter3 = Filter.fromText("www.example.com##.bar"); 618 let filter3 = Filter.fromText("www.example.com##.bar");
616 619
617 test.notEqual(filter2.domains, filter3.domains); 620 test.notEqual(filter2.domains, filter3.domains);
618 621
619 test.done(); 622 test.done();
620 }; 623 };
OLDNEW
« lib/filterClasses.js ('K') | « lib/filterClasses.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld