diff options
| author | Igor Minar | 2011-08-26 10:54:38 -0700 |
|---|---|---|
| committer | Igor Minar | 2011-08-29 14:38:28 -0700 |
| commit | 3ba90003b415542501a0732e09e1271bbd830eff (patch) | |
| tree | f4273e9e0fff70cf6831dc9c3ef98c812849f4b8 | |
| parent | 5927b23ef35736ec075e226c32d46decb5d42e34 (diff) | |
| download | angular.js-3ba90003b415542501a0732e09e1271bbd830eff.tar.bz2 | |
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
| -rw-r--r-- | test/BrowserSpecs.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/BrowserSpecs.js b/test/BrowserSpecs.js index a88df3f4..5cc7ae65 100644 --- a/test/BrowserSpecs.js +++ b/test/BrowserSpecs.js @@ -335,17 +335,17 @@ describe('browser', function(){ it('should log warnings when 4kb per cookie storage limit is reached', function() { var i, longVal = '', cookieStr; - for(i=0; i<4092; i++) { + for(i=0; i<4091; i++) { longVal += '+'; } cookieStr = document.cookie; - browser.cookies('x', longVal); //total size 4094-4096, so it should go through + browser.cookies('x', longVal); //total size 4093-4096, so it should go through expect(document.cookie).not.toEqual(cookieStr); expect(browser.cookies()['x']).toEqual(longVal); expect(logs.warn).toEqual([]); - browser.cookies('x', longVal + 'xxx'); //total size 4097-4099, a warning should be logged + browser.cookies('x', longVal + 'xxxx'); //total size 4097-4099, a warning should be logged expect(logs.warn).toEqual( [[ "Cookie 'x' possibly not set or overflowed because it was too large (4097 > 4096 " + "bytes)!" ]]); |
