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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/FileAPI/blob/Blob-XHR-revoke.html

Issue 1984023002: Move web-platform-tests to wpt (part 1 of 2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
1 <!doctype html> 1 <!doctype html>
2 <title>Revoking blob URL used with XMLHttpRequest</title> 2 <title>Revoking blob URL used with XMLHttpRequest</title>
3 <script src="../../../../resources/testharness.js"></script> 3 <script src="../../../../resources/testharness.js"></script>
4 <script src="../../../../resources/testharnessreport.js"></script> 4 <script src="../../../../resources/testharnessreport.js"></script>
5 5
6 <script> 6 <script>
7 async_test(function(t) { 7 async_test(function(t) {
8 var blob = new Blob(["test"]); 8 var blob = new Blob(["test"]);
9 var url = URL.createObjectURL(blob); 9 var url = URL.createObjectURL(blob);
10 var xhr = new XMLHttpRequest(); 10 var xhr = new XMLHttpRequest();
11 xhr.open("GET", url); 11 xhr.open("GET", url);
12 12
13 // Revoke the object URL. XHR should take a reference to the blob as soon a s 13 // Revoke the object URL. XHR should take a reference to the blob as soon a s
14 // it receives it in open(), so the request succeeds even though we revoke t he 14 // it receives it in open(), so the request succeeds even though we revoke t he
15 // URL before calling send(). 15 // URL before calling send().
16 URL.revokeObjectURL(url); 16 URL.revokeObjectURL(url);
17 17
18 xhr.send(); 18 xhr.send();
19 19
20 xhr.onload = t.step_func(function() { 20 xhr.onload = t.step_func(function() {
21 assert_equals(xhr.response, "test"); 21 assert_equals(xhr.response, "test");
22 t.done(); 22 t.done();
23 }) 23 })
24 xhr.onerror = t.step_func(function() { 24 xhr.onerror = t.step_func(function() {
25 assert_unreached("Got unexpected error event"); 25 assert_unreached("Got unexpected error event");
26 }) 26 })
27 }); 27 });
28 </script> 28 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698