mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-06 09:01:31 +08:00
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:
@@ -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);
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user