| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script type="text/javascript"> | 3 <script type="text/javascript"> |
| 4 function log(message) | 4 function log(message) |
| 5 { | 5 { |
| 6 document.getElementById('console').appendChild(document.createTextNode(messa
ge + "\n")); | 6 document.getElementById('console').appendChild(document.createTextNode(messa
ge + "\n")); |
| 7 } | 7 } |
| 8 | 8 |
| 9 if (window.testRunner) { | 9 if (window.testRunner) { |
| 10 testRunner.dumpAsText(); | 10 testRunner.dumpAsText(); |
| 11 testRunner.waitUntilDone(); | 11 testRunner.waitUntilDone(); |
| 12 } | 12 } |
| 13 | 13 |
| 14 var t = setInterval(function(){ | 14 function blobSent(event) { |
| 15 if (!location.hash) | 15 var blobURL = event.data.blobURL; |
| 16 return; | |
| 17 var blobURL = location.hash.substr(1); | |
| 18 if (blobURL == "null") | 16 if (blobURL == "null") |
| 19 log("FAIL: no blob URL is created"); | 17 log("FAIL: no blob URL is created"); |
| 20 else | 18 else |
| 21 log("PASS: created blob URL"); | 19 log("PASS: created blob URL"); |
| 22 clearInterval(t); | |
| 23 if (window.testRunner) | 20 if (window.testRunner) |
| 24 testRunner.notifyDone(); | 21 testRunner.notifyDone(); |
| 25 }, 100) | 22 }; |
| 23 |
| 24 window.addEventListener("message", blobSent, false); |
| 26 </script> | 25 </script> |
| 27 </head> | 26 </head> |
| 28 <body> | 27 <body> |
| 29 <p> Test case for checking blob URL can be created from the code running from da
ta URI</p> | 28 <p> Test case for checking blob URL can be created from the code running from da
ta URI</p> |
| 30 <pre id='console'></pre> | 29 <pre id='console'></pre> |
| 31 <iframe src="data:text/html,%3Cscript%3Evar%20bb%20%3D%20new%20Blob%28%5B%22Foo%
22%5D%2C%20%7Btype%3A%22text%2Fhtml%22%7D%29%3Btop.location%3D%27http%3A%2F%2F12
7.0.0.1%3A8000%2Ffileapi%2Fcreate-blob-url-from-data-url.html%23%27%20%2B%20wind
ow.URL.createObjectURL%28bb%29%3B%3C%2Fscript%3E"></iframe> | 30 <iframe src="data:text/html,<body><script>var bb = new Blob(['Foo'], {type:'text
/html'}); top.postMessage({blobURL: window.URL.createObjectURL(bb)}, '*');</scri
pt></body>"></iframe> |
| 32 </body> | 31 </body> |
| 33 </html> | 32 </html> |
| OLD | NEW |