Index: chrome/content/tests/filterNotifier.js |
=================================================================== |
--- a/chrome/content/tests/filterNotifier.js |
+++ b/chrome/content/tests/filterNotifier.js |
@@ -52,9 +52,23 @@ |
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(){ |
Thomas Greiner
2014/04/07 08:30:49
Nit: Move bracket to new line
|
+ 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]); |
+ }) |
Thomas Greiner
2014/04/07 08:30:49
Nit: Missing semicolon
|
})(); |