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

Side by Side Diff: LayoutTests/imported/web-platform-tests/FileAPI/blob/Blob-close.html

Issue 1295773004: update-w3c-deps import using blink c936ac9d274f959a4b5908db6835bcd612fb1a9e: (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 <meta charset=utf-8> 2 <meta charset=utf-8>
3 <title>Blob.close</title> 3 <title>Blob.close</title>
4 <link rel=help href="http://dev.w3.org/2006/webapi/FileAPI/#dfn-close"> 4 <link rel=help href="http://dev.w3.org/2006/webapi/FileAPI/#dfn-close">
5 <script src="../../../../resources/testharness.js"></script> 5 <script src="../../../../resources/testharness.js"></script>
6 <script src="../../../../resources/testharnessreport.js"></script> 6 <script src="../../../../resources/testharnessreport.js"></script>
7 <script src="../support/Blob.js"></script> 7 <script src="../support/Blob.js"></script>
8 <div id="log"></div> 8 <div id="log"></div>
9 <script> 9 <script>
10 test(function() { 10 test(function() {
11 var blob = new Blob(["TEST"]); 11 var blob = new Blob(["TEST"]);
12 var sliced = blob.slice(); 12 var sliced = blob.slice();
13 blob.close(); 13 blob.close();
14 test_blob(function() { 14
15 return blob; 15 async_test(function(t) {
16 }, { 16 var reader = new FileReader();
17 expected: "", 17
18 type: "", 18 reader.onload = t.step_func(function(evt) {
19 desc: "Blob should be empty." 19 assert_unreached("Should not dispatch the load event");
20 }); 20 });
21
22 reader.onerror = t.step_func(function(e) {
23 assert_equals(reader.result, null);
24 assert_equals(reader.error.code, DOMException.INVALID_STATE_ERR);
25 t.done();
26 });
27
28 reader.readAsText(blob, "UTF-8");
29 }, "Closed Blob");
30
21 test_blob(function() { 31 test_blob(function() {
22 return sliced; 32 return sliced;
23 }, { 33 }, {
24 expected: "PASS", 34 expected: "TEST",
25 type: "", 35 type: "",
26 desc: "Slice should still have the data." 36 desc: "Slice should still have the data."
27 }); 37 });
28 }); 38 });
29 </script> 39 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698