| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <meta charset="utf-8"> |
| 3 <title>FileAPI Test: Verify origin of Blob URL</title> |
| 4 <script src="/resources/testharness.js"></script> |
| 5 <script src="/resources/testharnessreport.js"></script> |
| 6 <body> |
| 7 <script> |
| 8 test(t => { |
| 9 const blob = new Blob(["Test Blob"]); |
| 10 const url = URL.createObjectURL(blob); |
| 11 assert_equals(new URL(url).origin, location.origin); |
| 12 assert_true(url.includes(location.origin)); |
| 13 assert_true(url.startsWith('blob:{{location[scheme]}}://')); |
| 14 }, 'Verify origin of Blob URI matches our origin'); |
| 15 |
| 16 async_test(t => { |
| 17 const frame = document.createElement('iframe'); |
| 18 self.addEventListener('message', t.step_func(e => { |
| 19 if (e.source != frame.contentWindow) return; |
| 20 const url = e.data.url; |
| 21 assert_false(url.includes('天気の良い日'), |
| 22 'Origin should be ascii rather than unicode'); |
| 23 assert_equals(new URL(url).origin, e.origin, |
| 24 'Origin of URL should match origin of frame'); |
| 25 assert_true(url.startsWith('blob:{{location[scheme]}}://xn--')); |
| 26 t.done(); |
| 27 })); |
| 28 frame.src = '{{location[scheme]}}://{{domains[天気の良い日]}}:{{location[port]}}/Fil
eAPI/support/url-origin.html'; |
| 29 document.body.appendChild(frame); |
| 30 }, 'Verify serialization of non-ascii origin in Blob URLs'); |
| 31 </script> |
| OLD | NEW |