aboutsummaryrefslogtreecommitdiffstats
path: root/test/angular-mocks.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/angular-mocks.js')
-rw-r--r--test/angular-mocks.js24
1 files changed, 9 insertions, 15 deletions
diff --git a/test/angular-mocks.js b/test/angular-mocks.js
index 1e547f77..a0d25042 100644
--- a/test/angular-mocks.js
+++ b/test/angular-mocks.js
@@ -29,7 +29,7 @@ function MockBrowser() {
this.isMock = true;
self.url = "http://server";
- self.watches = [];
+ self.pollFns = [];
self.xhr = function(method, url, data, callback) {
if (angular.isFunction(data)) {
@@ -78,6 +78,14 @@ function MockBrowser() {
}
MockBrowser.prototype = {
+ poll: function poll(){
+ foreach(this.pollFns, function(pollFn){ pollFn(); });
+ },
+
+ addPollFn: function(pollFn) {
+ this.pollFns.push(pollFn);
+ },
+
hover: function(onHover) {
},
@@ -89,20 +97,6 @@ MockBrowser.prototype = {
this.url = url;
},
- watchUrl: function(fn) {
- this.watches.push(fn);
- },
-
- watchCookies: function(fn) {
- this.watches.push(fn);
- },
-
- fireUrlWatchers: function() {
- for(var i=0; i<this.watches.length; i++) {
- this.watches[i](this.url);
- }
- },
-
cookies: function(name, value) {
if (name) {
if (value == undefined) {