Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions test/ng/parseSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,17 +206,13 @@ describe('parser', function() {

describe('csp: ' + cspEnabled + ", unwrapPromises: " + unwrapPromisesEnabled, function() {

var originalSecurityPolicy;


beforeEach(function() {
originalSecurityPolicy = window.document.securityPolicy;
window.document.securityPolicy = {isActive : cspEnabled};
});
beforeEach(module(function($provide) {
$provide.decorator('$sniffer', function($delegate) {
$delegate.csp = cspEnabled;
return $delegate;
});
}, provideLog));

afterEach(function() {
window.document.securityPolicy = originalSecurityPolicy;
});

beforeEach(module(function ($parseProvider, $provide) {
$parseProvider.unwrapPromises(unwrapPromisesEnabled);
Expand Down