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

Side by Side Diff: LayoutTests/fast/filesystem/resources/file-from-file-entry.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('fs-test-util.js'); 4 importScripts('fs-test-util.js');
5 } 5 }
6 6
7 description("Obtaining File from FileEntry."); 7 description("Obtaining File from FileEntry.");
8 8
9 var fileSystem = null; 9 var fileSystem = null;
10 var testFileName = '/testFileEntry.txt'; 10 var testFileName = '/testFileEntry.txt';
11 var testFileEntry = null; 11 var testFileEntry = null;
12 var testFile = null; 12 var testFile = null;
13 13
14 function errorCallback(error) { 14 function errorCallback(error) {
15 testFailed("Error occured:" + error.code); 15 testFailed("Error occured:" + error.name);
16 finishJSTest(); 16 finishJSTest();
17 } 17 }
18 18
19 function fileCallback(file) { 19 function fileCallback(file) {
20 testFile = file; 20 testFile = file;
21 shouldBe("testFile.name", "testFileEntry.name"); 21 shouldBe("testFile.name", "testFileEntry.name");
22 shouldBe("testFile.type", "'text/plain'"); 22 shouldBe("testFile.type", "'text/plain'");
23 shouldBe("testFile.size", "0"); 23 shouldBe("testFile.size", "0");
24 finishJSTest(); 24 finishJSTest();
25 } 25 }
26 26
27 function getFileFromEntry(entry) { 27 function getFileFromEntry(entry) {
28 testFileEntry = entry; 28 testFileEntry = entry;
29 entry.file(fileCallback, errorCallback); 29 entry.file(fileCallback, errorCallback);
30 } 30 }
31 31
32 function createTestFile() { 32 function createTestFile() {
33 fileSystem.root.getFile(testFileName, {create:true}, getFileFromEntry, error Callback); 33 fileSystem.root.getFile(testFileName, {create:true}, getFileFromEntry, error Callback);
34 } 34 }
35 35
36 function fileSystemCallback(fs) { 36 function fileSystemCallback(fs) {
37 fileSystem = fs; 37 fileSystem = fs;
38 removeAllInDirectory(fileSystem.root, createTestFile, errorCallback); 38 removeAllInDirectory(fileSystem.root, createTestFile, errorCallback);
39 } 39 }
40 40
41 var jsTestIsAsync = true; 41 var jsTestIsAsync = true;
42 webkitRequestFileSystem(TEMPORARY, 100, fileSystemCallback, errorCallback); 42 webkitRequestFileSystem(TEMPORARY, 100, fileSystemCallback, errorCallback);
OLDNEW
« no previous file with comments | « LayoutTests/fast/filesystem/resources/file-entry-to-uri.js ('k') | LayoutTests/fast/filesystem/resources/file-writer-abort.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698