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

chore(ngCsp): add e2e tests #9136

Closed
wants to merge 1 commit into from
Closed

chore(ngCsp): add e2e tests #9136

wants to merge 1 commit into from

Conversation

tbosch
Copy link
Contributor

@tbosch tbosch commented Sep 17, 2014

Also changes connect:devserver and connect:testserver to conditionally serve files with csp headers when the path contains .csp somewhere.

Depends on angular/dgeni-packages#70 to be merged and updated dgeni-packages to be included in angular.js

expectNoErrors();
});

it('should throw and report an error when using "eval"', function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do all the browsers we support respect CSP headers? I'm just not sure about safari 6

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Safari 6 does with a prefix: http://caniuse.com/#feat=contentsecuritypolicy

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like IE9 does not, which is a problem for travis. IE10/11 also use prefixed headers :( Just skip the test if ie is detected?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we need to do feature detection for IE9, but should keep testing IE10/11.

var evilBtn = element(by.id('evil'));
var evilError = element(by.id('evilError'));

function getAndClearSevereErrors() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how I feel about this; if I understand correctly, this clears all errors, but returns only the severe ones?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Ignores warnings about css problems, ...
Right now protractor just ignores the errors...

Also changes `connect:devserver` and `connect:testserver` to conditionally serve files with csp headers when the path contains `.csp` somewhere.

Depends on angular/dgeni-packages#70 to be merged and updated dgeni-packages to be included in angular.js
@tbosch tbosch closed this Sep 30, 2014
@tbosch tbosch deleted the csp branch September 30, 2014 21:10
tbosch added a commit that referenced this pull request Sep 30, 2014
Also changes `connect:devserver` and `connect:testserver` to conditionally serve files with csp headers when the path contains `.csp` somewhere.

Closes #9136
Closes #9059
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants