test($parse): ensure CSP code paths are used when testing

Previously, the test suite was not actually taking CSP-mode paths when we were expecting it to.

Numerous CSP-mode tests are failing, working on fixing these.
This commit is contained in:
Caitlin Potter
2014-09-12 15:05:50 -04:00
parent f2894c0f1d
commit a3fbf0ff5a

View File

@@ -202,8 +202,9 @@ describe('parser', function() {
forEach([true, false], function(cspEnabled) {
forEach([true, false], function(unwrapPromisesEnabled) {
describe('csp: ' + cspEnabled, function() {
describe('csp: ' + cspEnabled + ", unwrapPromises: " + unwrapPromisesEnabled, function() {
beforeEach(module(function($provide) {
$provide.decorator('$sniffer', function($delegate) {
@@ -213,15 +214,6 @@ describe('parser', function() {
}, provideLog));
beforeEach(function() {
originalSecurityPolicy = window.document.securityPolicy;
window.document.securityPolicy = {isActive : cspEnabled};
});
afterEach(function() {
window.document.securityPolicy = originalSecurityPolicy;
});
beforeEach(module(function ($parseProvider, $provide) {
$parseProvider.unwrapPromises(unwrapPromisesEnabled);
}));