Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(535)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worklet-import-blocked.html

Issue 2146633002: Enable checking for Content Security Policies before loading an external worklet script. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script>
6 <meta http-equiv="Content-Security-Policy" content="default-src 'none';script-sr c 'unsafe-inline'"/>
7
8 </head>
9 <body>
10 <script>
11 promise_test(function() {
12
13 return paintWorklet.import('/resources/worklet.js').then(function(undefi ned_arg) {
14 assert_unreached('import should fail.')
15 }).catch(function(error) {
yhirano 2016/07/21 05:16:56 This catches the assert_unreached exception. I wou
16 assert_equals(error.name, 'NetworkError', 'error should be a Network Error.');
17 });
18
19 }, 'Importing a script rejects the given promise with NetworkError because i t violated the same origin CSP policy.');
20 </script>
21 </body>
22 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698