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.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/angular-mocks.js b/test/angular-mocks.js
index b02fabaf..1a73a542 100644
--- a/test/angular-mocks.js
+++ b/test/angular-mocks.js
@@ -75,6 +75,7 @@ function MockBrowser() {
};
self.cookieHash = {};
+ self.lastCookieHash = {};
}
MockBrowser.prototype = {
@@ -103,12 +104,17 @@ MockBrowser.prototype = {
if (value == undefined) {
delete this.cookieHash[name];
} else {
- if (isString(value)) {
+ if (isString(value) && //strings only
+ value.length <= 4096) { //strict cookie storage limits
this.cookieHash[name] = value;
}
}
} else {
- return copy(this.cookieHash);
+ if (!equals(this.cookieHash, this.lastCookieHash)) {
+ this.lastCookieHash = copy(this.cookieHash);
+ this.cookieHash = copy(this.cookieHash);
+ }
+ return this.cookieHash;
}
}