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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/FileAPI/url/origin.sub.html

Issue 2675133002: Import wpt@97e16bef6d6599ae805521e2007a9430a12aa144 (Closed)
Patch Set: Revert change to W3CImportExpectations 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 <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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698