diff options
| author | Tobias Bosch | 2013-11-19 20:42:38 -0800 | 
|---|---|---|
| committer | Pete Bacon Darwin | 2013-11-20 23:12:39 +0000 | 
| commit | ec3c4f94c79e23c29abcde6e1d2f6eaf05e0664c (patch) | |
| tree | b012206a97beda4a868f2a27a243a643a4f6cd74 /test/ng/sceSpecs.js | |
| parent | 6b8bbe4d90640542eed5607a8c91f6b977b1d6c0 (diff) | |
| download | angular.js-ec3c4f94c79e23c29abcde6e1d2f6eaf05e0664c.tar.bz2 | |
refactor($sce): Use $sniffer instead of $document for feature detection.
Also adds `$sniffer.msieDocumentMode` property.
Closes #4931
Closes #5045
Diffstat (limited to 'test/ng/sceSpecs.js')
| -rw-r--r-- | test/ng/sceSpecs.js | 33 | 
1 files changed, 13 insertions, 20 deletions
| diff --git a/test/ng/sceSpecs.js b/test/ng/sceSpecs.js index e1588fe2..66c05c0d 100644 --- a/test/ng/sceSpecs.js +++ b/test/ng/sceSpecs.js @@ -29,10 +29,10 @@ describe('SCE', function() {    describe('IE8 quirks mode', function() {      function runTest(enabled, documentMode, expectException) {        module(function($provide) { -        $provide.value('$document', [{ -          documentMode: documentMode, -          createElement: function() {} -        }]); +        $provide.value('$sniffer', { +          msie: documentMode, +          msieDocumentMode: documentMode +        });          $provide.value('$sceDelegate', {trustAs: null, valueOf: null, getTrusted: null});        }); @@ -43,22 +43,15 @@ describe('SCE', function() {            return $injector.invoke(sceProvider.$get, sceProvider);          } -        var origMsie = $window.msie; -        try { -          $window.msie = true; -          if (expectException) { -            expect(constructSce).toThrowMinErr( -                '$sce', 'iequirks', 'Strict Contextual Escaping does not support Internet Explorer ' + -                'version < 9 in quirks mode.  You can fix this by adding the text <!doctype html> to ' + -                'the top of your HTML document.  See http://docs.angularjs.org/api/ng.$sce for more ' + -                'information.'); -          } else { -            // no exception. -            constructSce(); -          } -        } -        finally { -          $window.msie = origMsie; +        if (expectException) { +          expect(constructSce).toThrowMinErr( +            '$sce', 'iequirks', 'Strict Contextual Escaping does not support Internet Explorer ' + +              'version < 9 in quirks mode.  You can fix this by adding the text <!doctype html> to ' + +              'the top of your HTML document.  See http://docs.angularjs.org/api/ng.$sce for more ' + +              'information.'); +        } else { +          // no exception. +          constructSce();          }        });      } | 
