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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/content-security-policy/blink-contrib/filesystem-urls-do-not-match-self.sub.html

Issue 2695813009: Import wpt@503f5b5f78ec4e87d144f78609f363f0ed0ea8db (Closed)
Patch Set: Skip some tests Created 3 years, 10 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
4 <head>
5 <!-- Programmatically converted from a WebKit Reftest, please forgive result ing idiosyncracies.-->
6 <title>filesystem-urls-do-not-match-self</title>
7 <script src="/resources/testharness.js"></script>
8 <script src="/resources/testharnessreport.js"></script>
9 <script src="../support/logTest.sub.js?logs=[]"></script>
10 <script src="../support/alertAssert.sub.js?alerts=[]"></script>
11 <!-- enforcing policy:
12 script-src 'self' 'unsafe-inline' 'self'; connect-src 'self';
13 -->
14 </head>
15
16 <body>
17 <p>
18 filesystem: URLs are same-origin with the page in which they were create d, but explicitly do not match the &apos;self&apos; or &apos;*&apos; source in C SP directives because they are more akin to 'unsafe-inline' content..
19 </p>
20 <script>
21 if(!window.webkitRequestFileSystem) {
22 t_log = async_test();
23 t_log.set_status(t_log.NOTRUN, "No filesystem:// support, cannot run test.");
24 t_log.phase = t_log.phases.HAS_RESULT;
25 t_log.done();
26 } else {
27 function fail() {
28 alert_assert("FAIL!");
29 }
30 window.webkitRequestFileSystem(
31 TEMPORARY, 1024 * 1024 /*1MB*/ , function(fs) {
32 fs.root.getFile('fail.js', {
33 create: true
34 }, function(fileEntry) {
35 fileEntry.createWriter(function(fileWriter) {
36 fileWriter.onwriteend = function(e) {
37 var script = document.createElement('script');
38 script.src = fileEntry.toURL('application/javasc ript');
39 document.body.appendChild(script);
40 };
41 // Create a new Blob and write it to pass.js.
42 var b = new Blob(['fail();'], {
43 type: 'application/javascript'
44 });
45 fileWriter.write(b);
46 });
47 });
48 });
49 var s = document.createElement('script');
50 s.async = true;
51 s.defer = true;
52 s.src = "../support/checkReport.sub.js?reportExists=true&amp;reportF ield=violated-directive&amp;reportValue=script-src%20&apos;self&apos;%20&apos;un safe-inline&apos;%20&apos;*&apos;"
53 document.lastChild.appendChild(s);
54 }
55
56
57 </script>
58 <div id="log"></div>
59
60 </body>
61
62 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698