• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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>
8async_test(t => {
9  const frame = document.createElement('iframe');
10  self.addEventListener('message', t.step_func(e => {
11      if (e.source != frame.contentWindow) return;
12      const url = e.data.url;
13      assert_false(url.includes('天気の良い日'),
14          'Origin should be ascii rather than unicode');
15      assert_equals(new URL(url).origin, e.origin,
16          'Origin of URL should match origin of frame');
17      assert_true(url.startsWith('blob:{{location[scheme]}}://xn--'));
18      t.done();
19    }));
20  frame.src = '{{location[scheme]}}://{{domains[天気の良い日]}}:{{location[port]}}/FileAPI/support/url-origin.html';
21  document.body.appendChild(frame);
22}, 'Verify serialization of non-ascii origin in Blob URLs');
23</script>
24