diff options
| author | Chirayu Krishnappa | 2013-08-26 17:26:08 -0700 | 
|---|---|---|
| committer | Chirayu Krishnappa | 2013-08-29 16:07:49 -0700 | 
| commit | 427ee93f11d0ef64b8844f9b43b2a0f21f2be2cb (patch) | |
| tree | cad19245850549d9ce765164a8f114a443e16cba /test/AngularSpec.js | |
| parent | 366c0e084b16c51dc1d1e5a47ac71d2770fdcc40 (diff) | |
| download | angular.js-427ee93f11d0ef64b8844f9b43b2a0f21f2be2cb.tar.bz2 | |
fix(core): parse IE11 UA string correctly
It's great that IE11 wants to be compatible enough that it doesn't want
to be special cased and treated differently.
However, as long as one has to have a different code path for IE than
for the other supported browsers, we still need to detect and special
case it.  For instance, our URL parsing code still needs the same
workaround the we used for IE10.  We still see the same Access denied /
TypeError exceptions when setting certain values.  FYI, Angular doesn't
generally blindly test for IE – we also check the version number.
Thanks to modern.ie for the free IE11 test VM.
Closes #3682
Diffstat (limited to 'test/AngularSpec.js')
| -rw-r--r-- | test/AngularSpec.js | 15 | 
1 files changed, 15 insertions, 0 deletions
| diff --git a/test/AngularSpec.js b/test/AngularSpec.js index 344e2ead..f6796496 100644 --- a/test/AngularSpec.js +++ b/test/AngularSpec.js @@ -1003,4 +1003,19 @@ describe('angular', function() {      });    }); +  describe('msie UA parsing', function() { +    if (/ Trident\/.*; rv:/.test(window.navigator.userAgent)) { +      it('should fail when the Trident and the rv versions disagree for IE11+', function() { +        // When this test fails, we can think about whether we want to use the version from the +        // Trident token in the UA string or stick with the version from rv: as we currently do. +        // Refer https://github.com/angular/angular.js/pull/3758#issuecomment-23529245 for the +        // discussion. +        var UA = window.navigator.userAgent; +        var tridentVersion = parseInt((/Trident\/(\d+)/.exec(UA) || [])[1], 10) + 4; +        var rvVersion = parseInt((/Trident\/.*; rv:(\d+)/.exec(UA) || [])[1], 10); +        expect(tridentVersion).toBe(rvVersion); +      }); +    } +  }); +  }); | 
