Skip to content

Commit 3ba9000

Browse files
committed
fix(test): improve $cookie service test to work with Safari 5.1
the max size for safari cookies has changed sligtly so I had to adjust the test to make cookie creation fail on this browser
1 parent 5927b23 commit 3ba9000

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/BrowserSpecs.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,17 +335,17 @@ describe('browser', function(){
335335
it('should log warnings when 4kb per cookie storage limit is reached', function() {
336336
var i, longVal = '', cookieStr;
337337

338-
for(i=0; i<4092; i++) {
338+
for(i=0; i<4091; i++) {
339339
longVal += '+';
340340
}
341341

342342
cookieStr = document.cookie;
343-
browser.cookies('x', longVal); //total size 4094-4096, so it should go through
343+
browser.cookies('x', longVal); //total size 4093-4096, so it should go through
344344
expect(document.cookie).not.toEqual(cookieStr);
345345
expect(browser.cookies()['x']).toEqual(longVal);
346346
expect(logs.warn).toEqual([]);
347347

348-
browser.cookies('x', longVal + 'xxx'); //total size 4097-4099, a warning should be logged
348+
browser.cookies('x', longVal + 'xxxx'); //total size 4097-4099, a warning should be logged
349349
expect(logs.warn).toEqual(
350350
[[ "Cookie 'x' possibly not set or overflowed because it was too large (4097 > 4096 " +
351351
"bytes)!" ]]);

0 commit comments

Comments
 (0)