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

Side by Side Diff: chrome/content/common.js

Issue 29324604: Issue 2394 - Added unit tests for CSS property filters (Closed)
Patch Set: Created Aug. 25, 2015, 3:51 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 | « no previous file | chrome/content/tests/cssRules.js » ('j') | chrome/content/tests/cssRules.js » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 const Cc = Components.classes; 1 const Cc = Components.classes;
2 const Ci = Components.interfaces; 2 const Ci = Components.interfaces;
3 const Cr = Components.results; 3 const Cr = Components.results;
4 const Cu = Components.utils; 4 const Cu = Components.utils;
5 5
6 const MILLIS_IN_SECOND = 1000; 6 const MILLIS_IN_SECOND = 1000;
7 const MILLIS_IN_MINUTE = 60 * MILLIS_IN_SECOND; 7 const MILLIS_IN_MINUTE = 60 * MILLIS_IN_SECOND;
8 const MILLIS_IN_HOUR = 60 * MILLIS_IN_MINUTE; 8 const MILLIS_IN_HOUR = 60 * MILLIS_IN_MINUTE;
9 const MILLIS_IN_DAY = 24 * MILLIS_IN_HOUR; 9 const MILLIS_IN_DAY = 24 * MILLIS_IN_HOUR;
10 10
(...skipping 19 matching lines...) Expand all
30 if (addonID in XPIProvider.bootstrapScopes) 30 if (addonID in XPIProvider.bootstrapScopes)
31 result = XPIProvider.bootstrapScopes[addonID]; 31 result = XPIProvider.bootstrapScopes[addonID];
32 } 32 }
33 33
34 if ("require" in result) 34 if ("require" in result)
35 result = result.require.scopes[module]; 35 result = result.require.scopes[module];
36 return result; 36 return result;
37 } 37 }
38 38
39 let {Filter, InvalidFilter, CommentFilter, ActiveFilter, RegExpFilter, 39 let {Filter, InvalidFilter, CommentFilter, ActiveFilter, RegExpFilter,
40 BlockingFilter, WhitelistFilter, ElemHideBase, ElemHideFilter, ElemHideExce ption} = require("filterClasses"); 40 BlockingFilter, WhitelistFilter, ElemHideBase, ElemHideFilter,
41 ElemHideException, CSSPropertyFilter} = require("filterClasses");
41 let {Subscription, SpecialSubscription, RegularSubscription, 42 let {Subscription, SpecialSubscription, RegularSubscription,
42 ExternalSubscription, DownloadableSubscription} = require("subscriptionClas ses"); 43 ExternalSubscription, DownloadableSubscription} = require("subscriptionClas ses");
43 let {defaultMatcher, Matcher, CombinedMatcher} = require("matcher"); 44 let {defaultMatcher, Matcher, CombinedMatcher} = require("matcher");
44 let {FilterListener} = require("filterListener"); 45 let {FilterListener} = require("filterListener");
45 let {FilterNotifier} = require("filterNotifier"); 46 let {FilterNotifier} = require("filterNotifier");
46 let {FilterStorage} = require("filterStorage"); 47 let {FilterStorage} = require("filterStorage");
47 let {ElemHide} = require("elemHide"); 48 let {ElemHide} = require("elemHide");
49 let {CSSRules} = require("cssRules");
48 let {IO} = require("io"); 50 let {IO} = require("io");
49 let {Notification} = require("notification"); 51 let {Notification} = require("notification");
50 let {Prefs} = require("prefs"); 52 let {Prefs} = require("prefs");
51 let {RequestNotifier} = require("requestNotifier"); 53 let {RequestNotifier} = require("requestNotifier");
52 let {Synchronizer} = require("synchronizer"); 54 let {Synchronizer} = require("synchronizer");
53 let {UI} = require("ui"); 55 let {UI} = require("ui");
54 let {Utils} = require("utils"); 56 let {Utils} = require("utils");
55 57
56 let geckoVersion = Services.appinfo.platformVersion; 58 let geckoVersion = Services.appinfo.platformVersion;
57 function compareGeckoVersion(version) 59 function compareGeckoVersion(version)
(...skipping 18 matching lines...) Expand all
76 FilterStorage.knownSubscriptions = {__proto__: null}; 78 FilterStorage.knownSubscriptions = {__proto__: null};
77 Subscription.knownSubscriptions = {__proto__: null}; 79 Subscription.knownSubscriptions = {__proto__: null};
78 Filter.knownFilters = {__proto__: null}; 80 Filter.knownFilters = {__proto__: null};
79 if (!keepListeners) 81 if (!keepListeners)
80 { 82 {
81 FilterNotifierGlobal.listeners = []; 83 FilterNotifierGlobal.listeners = [];
82 } 84 }
83 85
84 defaultMatcher.clear(); 86 defaultMatcher.clear();
85 ElemHide.clear(); 87 ElemHide.clear();
88 CSSRules.clear();
86 } 89 }
87 90
88 function restoreFilterComponents() 91 function restoreFilterComponents()
89 { 92 {
90 let FilterNotifierGlobal = getModuleGlobal("filterNotifier"); 93 let FilterNotifierGlobal = getModuleGlobal("filterNotifier");
91 94
92 FilterStorage.subscriptions = this._backup.subscriptions; 95 FilterStorage.subscriptions = this._backup.subscriptions;
93 FilterStorage.knownSubscriptions = this._backup.storageKnown; 96 FilterStorage.knownSubscriptions = this._backup.storageKnown;
94 Subscription.knownSubscriptions = this._backup.subscriptionsKnown; 97 Subscription.knownSubscriptions = this._backup.subscriptionsKnown;
95 Filter.knownFilters = this._backup.filtersKnown; 98 Filter.knownFilters = this._backup.filtersKnown;
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 return oldFinish.apply(this, arguments); 524 return oldFinish.apply(this, arguments);
522 } 525 }
523 window.addEventListener("unload", function() 526 window.addEventListener("unload", function()
524 { 527 {
525 debuggerService.off(); 528 debuggerService.off();
526 }, true); 529 }, true);
527 debuggerService.on(); 530 debuggerService.on();
528 debuggerService.flags |= debuggerService.COLLECT_PROFILE_DATA; 531 debuggerService.flags |= debuggerService.COLLECT_PROFILE_DATA;
529 debuggerService.clearProfileData(); 532 debuggerService.clearProfileData();
530 } 533 }
OLDNEW
« no previous file with comments | « no previous file | chrome/content/tests/cssRules.js » ('j') | chrome/content/tests/cssRules.js » ('J')

Powered by Google App Engine
This is Rietveld