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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/register-bypassing-scheme-partial.html

Issue 2231523002: Make ResourceFetcher return Resources with LoadError instead of nullptrs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase, resolve comment rewrap conflicts. Created 4 years, 2 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <meta http-equiv="Content-Security-Policy" content="default-src https:; script-s rc 'unsafe-inline'"> 4 <meta http-equiv="Content-Security-Policy" content="default-src https:; script-s rc 'unsafe-inline'">
5 <script> 5 <script>
6 if (window.testRunner) { 6 if (window.testRunner) {
7 testRunner.waitUntilDone(); 7 testRunner.waitUntilDone();
8 testRunner.dumpAsText(); 8 testRunner.dumpAsText();
9 } 9 }
10 10
(...skipping 16 matching lines...) Expand all
27 img.src = '../resources/abe.png'; 27 img.src = '../resources/abe.png';
28 })); 28 }));
29 } 29 }
30 30
31 function expectStyleLoad(shouldLoad) { 31 function expectStyleLoad(shouldLoad) {
32 // onerror doesn't seem to work on <link>. 32 // onerror doesn't seem to work on <link>.
33 // Fortunately, srcdoc iframes are bound by containing CSP. 33 // Fortunately, srcdoc iframes are bound by containing CSP.
34 return produceOutput(new Promise(function(resolve, reject) { 34 return produceOutput(new Promise(function(resolve, reject) {
35 var iframe = document.createElement('iframe'); 35 var iframe = document.createElement('iframe');
36 iframe.onload = function() { 36 iframe.onload = function() {
37 var didLoad = iframe.contentDocument.styleSheets.length > 0; 37 var didLoad = iframe.contentDocument.styleSheets.length > 0 && i frame.contentDocument.styleSheets[0].rules.length > 0;
38 (shouldLoad == didLoad) ? resolve() : reject(new Error()); 38 (shouldLoad == didLoad) ? resolve() : reject(new Error());
39 setTimeout(function() { iframe.remove(); }, 0); 39 setTimeout(function() { iframe.remove(); }, 0);
40 }; 40 };
41 iframe.srcdoc = '<link rel="stylesheet" href="../resources/cssStyle. css">'; 41 iframe.srcdoc = '<link rel="stylesheet" href="../resources/cssStyle. css">';
42 document.body.appendChild(iframe); 42 document.body.appendChild(iframe);
43 })); 43 }));
44 } 44 }
45 45
46 window.onload = function() { 46 window.onload = function() {
47 Promise.resolve() 47 Promise.resolve()
(...skipping 27 matching lines...) Expand all
75 }; 75 };
76 </script> 76 </script>
77 </head> 77 </head>
78 <body> 78 <body>
79 <p> 79 <p>
80 This test ensures that registering a scheme as bypassing CSP actually by passes CSP. 80 This test ensures that registering a scheme as bypassing CSP actually by passes CSP.
81 This test passes if only PASSes are generated. 81 This test passes if only PASSes are generated.
82 </p> 82 </p>
83 </body> 83 </body>
84 </html> 84 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698