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

Side by Side Diff: LayoutTests/fast/filesystem/script-tests/read-directory.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 description("DirectoryReader.readEntries() test."); 1 description("DirectoryReader.readEntries() test.");
2 var fileSystem = null; 2 var fileSystem = null;
3 var reader = null; 3 var reader = null;
4 var resultEntries = []; 4 var resultEntries = [];
5 5
6 var readEntriesCount = 0; 6 var readEntriesCount = 0;
7 var entriesCallbackCount = 0; 7 var entriesCallbackCount = 0;
8 8
9 // path: isDirectory map. 9 // path: isDirectory map.
10 var testEntries = { 10 var testEntries = {
11 '/a': true, 11 '/a': true,
12 '/b': false, 12 '/b': false,
13 '/c': true, 13 '/c': true,
14 '/d': false, 14 '/d': false,
15 '/e': false, 15 '/e': false,
16 '/f': true, 16 '/f': true,
17 }; 17 };
18 var testEntriesCount = 0; 18 var testEntriesCount = 0;
19 19
20 function endTest() 20 function endTest()
21 { 21 {
22 removeAllInDirectory(fileSystem.root); 22 removeAllInDirectory(fileSystem.root);
23 finishJSTest(); 23 finishJSTest();
24 } 24 }
25 25
26 function errorCallback(error) 26 function errorCallback(error)
27 { 27 {
28 debug("Error occured:" + error.code); 28 debug("Error occured:" + error.name);
29 endTest(); 29 endTest();
30 } 30 }
31 31
32 var entry = null; 32 var entry = null;
33 function verifyTestResult() 33 function verifyTestResult()
34 { 34 {
35 shouldBe('readEntriesCount', 'entriesCallbackCount'); 35 shouldBe('readEntriesCount', 'entriesCallbackCount');
36 shouldBe('resultEntries.length', 'testEntriesCount'); 36 shouldBe('resultEntries.length', 'testEntriesCount');
37 resultEntries.sort(function(a, b) { return (a.fullPath > b.fullPath) ? 1 : ( a.fullPath < b.fullPath) ? -1 : 0; }); 37 resultEntries.sort(function(a, b) { return (a.fullPath > b.fullPath) ? 1 : ( a.fullPath < b.fullPath) ? -1 : 0; });
38 for (i = 0; i < resultEntries.length; ++i) { 38 for (i = 0; i < resultEntries.length; ++i) {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 fileSystem = fs; 87 fileSystem = fs;
88 debug("Successfully obtained Persistent FileSystem:" + fileSystem.name); 88 debug("Successfully obtained Persistent FileSystem:" + fileSystem.name);
89 removeAllInDirectory(fileSystem.root, prepareForTest, errorCallback); 89 removeAllInDirectory(fileSystem.root, prepareForTest, errorCallback);
90 } 90 }
91 91
92 if (window.webkitRequestFileSystem) { 92 if (window.webkitRequestFileSystem) {
93 webkitRequestFileSystem(window.TEMPORARY, 100, successCallback, errorCallbac k); 93 webkitRequestFileSystem(window.TEMPORARY, 100, successCallback, errorCallbac k);
94 window.jsTestIsAsync = true; 94 window.jsTestIsAsync = true;
95 } else 95 } else
96 debug("This test requires FileSystem API support."); 96 debug("This test requires FileSystem API support.");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698