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

Unified Diff: chrome/content/tests/filterNotifier.js

Issue 29355735: Issue 4223 - Remove tests migrated to adblockpluscore (Closed)
Patch Set: Restored elemhide.js Created Oct. 4, 2016, 2:19 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/content/tests/filterListener.js ('k') | chrome/content/tests/filterStorage.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/content/tests/filterNotifier.js
diff --git a/chrome/content/tests/filterNotifier.js b/chrome/content/tests/filterNotifier.js
deleted file mode 100644
index e7e3951a73cad53253e1ed48ee2ac7f421d8ea16..0000000000000000000000000000000000000000
--- a/chrome/content/tests/filterNotifier.js
+++ /dev/null
@@ -1,75 +0,0 @@
-(function()
-{
- module("Filter notifier", {setup: prepareFilterComponents, teardown: restoreFilterComponents});
-
- let triggeredListeners = [];
- let listeners = [
- (action, item) => triggeredListeners.push(["listener1", action, item]),
- (action, item) => triggeredListeners.push(["listener2", action, item]),
- (action, item) => triggeredListeners.push(["listener3", action, item])
- ];
-
- function compareListeners(test, list)
- {
- let result1 = triggeredListeners = [];
- FilterNotifier.triggerListeners("foo", {bar: true});
-
- let result2 = triggeredListeners = [];
- for (let observer of list)
- observer("foo", {bar: true});
-
- deepEqual(result1, result2, test);
- }
-
- test("Adding/removing listeners", function()
- {
- let [listener1, listener2, listener3] = listeners;
-
- compareListeners("No listeners", []);
-
- FilterNotifier.addListener(listener1);
- compareListeners("addListener(listener1)", [listener1]);
-
- FilterNotifier.addListener(listener1);
- compareListeners("addListener(listener1) again", [listener1]);
-
- FilterNotifier.addListener(listener2);
- compareListeners("addListener(listener2)", [listener1, listener2]);
-
- FilterNotifier.removeListener(listener1);
- compareListeners("removeListener(listener1)", [listener2]);
-
- FilterNotifier.removeListener(listener1);
- compareListeners("removeListener(listener1) again", [listener2]);
-
- FilterNotifier.addListener(listener3);
- compareListeners("addListener(listener3)", [listener2, listener3]);
-
- FilterNotifier.addListener(listener1);
- compareListeners("addListener(listener1)", [listener2, listener3, listener1]);
-
- FilterNotifier.removeListener(listener3);
- compareListeners("removeListener(listener3)", [listener2, listener1]);
-
- FilterNotifier.removeListener(listener1);
- compareListeners("removeListener(listener1)", [listener2]);
-
- FilterNotifier.removeListener(listener2);
- compareListeners("removeListener(listener2)", []);
- });
-
- test("Removing listeners while being called", function()
- {
- let listener1 = function()
- {
- listeners[0].apply(this, arguments);
- FilterNotifier.removeListener(listener1);
- };
- let listener2 = listeners[1];
- FilterNotifier.addListener(listener1);
- FilterNotifier.addListener(listener2);
-
- compareListeners("Initial call", [listener1, listener2]);
- compareListeners("Subsequent calls", [listener2]);
- });
-})();
« no previous file with comments | « chrome/content/tests/filterListener.js ('k') | chrome/content/tests/filterStorage.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld