OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <body> | 3 <body> |
4 <iframe></iframe> | 4 <iframe></iframe> |
5 <p> | 5 <p> |
6 This tests that filesystem URLs created in a secure context are treated as | 6 This tests that filesystem URLs created in a secure context are treated as |
7 secure origins. This test passes if the iframe renders PASS correctly, and no | 7 secure origins. This test passes if the iframe renders PASS correctly, and no |
8 console warning appears. | 8 console warning appears. |
9 </p> | 9 </p> |
10 | 10 |
11 <script> | 11 <script> |
12 if (window.testRunner) { | 12 if (window.testRunner) { |
13 testRunner.dumpAsText(); | 13 testRunner.dumpAsText(); |
14 testRunner.dumpChildFramesAsText(); | 14 testRunner.dumpChildFramesAsText(); |
15 testRunner.waitUntilDone(); | 15 testRunner.waitUntilDone(); |
16 } | 16 } |
17 | 17 |
18 if (location.protocol != 'https:') | 18 if (location.protocol != 'https:') |
19 location = 'https://127.0.0.1:8443/security/mixedContent/filesystem-url-in-i
frame.html'; | 19 location = 'https://127.0.0.1:8443/security/mixedContent/filesystem-url-in-i
frame.html'; |
20 else { | 20 else { |
21 var iframe = document.querySelector('iframe'); | 21 var iframe = document.querySelector('iframe'); |
22 iframe.onload = function () { | |
23 if (window.testRunner) | |
24 testRunner.notifyDone(); | |
25 }; | |
26 | 22 |
27 // Opening a file system with temporary storage | 23 // Opening a file system with temporary storage |
28 window.webkitRequestFileSystem(TEMPORARY, 1024*1024 /*1MB*/, function(fs) { | 24 window.webkitRequestFileSystem(TEMPORARY, 1024*1024 /*1MB*/, function(fs) { |
29 fs.root.getFile('test.html', {create: true}, function(fileEntry) { | 25 fs.root.getFile('test.html', {create: true}, function(fileEntry) { |
30 fileEntry.createWriter(function(fileWriter) { | 26 fileEntry.createWriter(function(fileWriter) { |
31 fileWriter.onwriteend = function(e) { | 27 fileWriter.onwriteend = function(e) { |
32 alert('PASS (1/2): File written'); | 28 alert('PASS (1/2): File written'); |
| 29 iframe.onload = function () { |
| 30 if (window.testRunner) |
| 31 testRunner.notifyDone(); |
| 32 }; |
33 iframe.src = fileEntry.toURL('text/html'); | 33 iframe.src = fileEntry.toURL('text/html'); |
34 }; | 34 }; |
35 | 35 |
36 // Create a new Blob and write it to log.txt. | 36 // Create a new Blob and write it to log.txt. |
37 var b = new Blob(['PASS (2/2): File displayed'], { type: 'text/h
tml' }); | 37 var b = new Blob(['PASS (2/2): File displayed'], { type: 'text/h
tml' }); |
38 fileWriter.write(b); | 38 fileWriter.write(b); |
39 }); | 39 }); |
40 }); | 40 }); |
41 }); | 41 }); |
42 } | 42 } |
43 </script> | 43 </script> |
44 </body> | 44 </body> |
45 </html> | 45 </html> |
OLD | NEW |