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

Side by Side Diff: LayoutTests/fast/filesystem/resources/file-writer-abort.js

Issue 22831019: Deprecate FileError in FileAPI (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: win test expectation fix (temporary) Created 7 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 | Annotate | Revision Log
OLDNEW
1 if (this.importScripts) { 1 if (this.importScripts) {
2 importScripts('fs-worker-common.js'); 2 importScripts('fs-worker-common.js');
3 importScripts('../../js/resources/js-test-pre.js'); 3 importScripts('../../js/resources/js-test-pre.js');
4 importScripts('file-writer-utils.js'); 4 importScripts('file-writer-utils.js');
5 } 5 }
6 6
7 description("Test that FileWriter handles abort properly."); 7 description("Test that FileWriter handles abort properly.");
8 8
9 var sawWriteStart; 9 var sawWriteStart;
10 var sawAbort; 10 var sawAbort;
(...skipping 20 matching lines...) Expand all
31 writer.abort(); 31 writer.abort();
32 } 32 }
33 33
34 // We should always abort before completion. 34 // We should always abort before completion.
35 function onWrite(e) { 35 function onWrite(e) {
36 testFailed("In onWrite."); 36 testFailed("In onWrite.");
37 } 37 }
38 38
39 function onAbort(e) { 39 function onAbort(e) {
40 assert(writer.readyState == writer.DONE); 40 assert(writer.readyState == writer.DONE);
41 assert(writer.error.code == writer.error.ABORT_ERR); 41 assert(writer.error.name == "AbortError");
42 assert(sawWriteStart); 42 assert(sawWriteStart);
43 assert(!sawWriteEnd); 43 assert(!sawWriteEnd);
44 assert(!sawAbort); 44 assert(!sawAbort);
45 assert(e.type == "abort"); 45 assert(e.type == "abort");
46 sawAbort = true; 46 sawAbort = true;
47 testPassed("Saw abort"); 47 testPassed("Saw abort");
48 } 48 }
49 49
50 function onWriteEnd(e) { 50 function onWriteEnd(e) {
51 assert(writer.readyState == writer.DONE); 51 assert(writer.readyState == writer.DONE);
52 assert(writer.error.code == writer.error.ABORT_ERR); 52 assert(writer.error.name == "AbortError");
53 assert(sawWriteStart); 53 assert(sawWriteStart);
54 assert(sawAbort); 54 assert(sawAbort);
55 assert(!sawWriteEnd); 55 assert(!sawWriteEnd);
56 assert(e.type == "writeend"); 56 assert(e.type == "writeend");
57 sawWriteEnd = true; 57 sawWriteEnd = true;
58 testPassed("Saw writeend."); 58 testPassed("Saw writeend.");
59 writer.abort(); // Verify that this does nothing in readyState DONE. 59 writer.abort(); // Verify that this does nothing in readyState DONE.
60 cleanUp(); 60 cleanUp();
61 } 61 }
62 62
(...skipping 12 matching lines...) Expand all
75 fileWriter.onwriteend = onWriteEnd; 75 fileWriter.onwriteend = onWriteEnd;
76 fileWriter.abort(); // Verify that this does nothing in readyState INIT. 76 fileWriter.abort(); // Verify that this does nothing in readyState INIT.
77 fileWriter.write(blob); 77 fileWriter.write(blob);
78 } 78 }
79 79
80 function runTest(unusedFileEntry, fileWriter) { 80 function runTest(unusedFileEntry, fileWriter) {
81 startWrite(fileWriter); 81 startWrite(fileWriter);
82 } 82 }
83 var jsTestIsAsync = true; 83 var jsTestIsAsync = true;
84 setupAndRunTest(2*1024*1024, 'file-writer-abort', runTest); 84 setupAndRunTest(2*1024*1024, 'file-writer-abort', runTest);
OLDNEW
« no previous file with comments | « LayoutTests/fast/filesystem/resources/file-from-file-entry.js ('k') | LayoutTests/fast/filesystem/resources/op-copy.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698