OLD | NEW |
1 if (this.importScripts) { | 1 if (this.importScripts) { |
2 importScripts('../resources/fs-worker-common.js'); | 2 importScripts('../resources/fs-worker-common.js'); |
3 importScripts('../resources/fs-test-util.js'); | 3 importScripts('../resources/fs-test-util.js'); |
4 } | 4 } |
5 | 5 |
6 description("Tests using webkitResolveLocalFileSystemURL to obtain an Entry from
a URL"); | 6 description("Tests using webkitResolveLocalFileSystemURL to obtain an Entry from
a URL"); |
7 | 7 |
8 var testFileName = '/testFile'; | 8 var testFileName = '/testFile'; |
9 var fileSystem = null; | 9 var fileSystem = null; |
10 var expectedPath = null; | 10 var expectedPath = null; |
11 var actualPath = null; | 11 var actualPath = null; |
12 var errorCode = null; | 12 var errorName = null; |
13 | 13 |
14 function errorCallback(error) { | 14 function errorCallback(error) { |
15 if (error && error.code) | 15 if (error && error.name) |
16 debug("Error occurred: " + error.code); | 16 debug("Error occurred: " + error.name); |
17 testFailed("Bailing out early"); | 17 testFailed("Bailing out early"); |
18 finishJSTest(); | 18 finishJSTest(); |
19 } | 19 } |
20 | 20 |
21 function expectSecurityErrAndRunNext(error) { | 21 function expectSecurityErrAndRunNext(error) { |
22 errorCode = error.code; | 22 errorName = error.name; |
23 shouldBe("FileError.SECURITY_ERR", "errorCode"); | 23 shouldBe('"SecurityError"', "errorName"); |
24 cleanupAndRunNext(); | 24 cleanupAndRunNext(); |
25 } | 25 } |
26 | 26 |
27 function expectEncodingErrAndRunNext(error) { | 27 function expectEncodingErrAndRunNext(error) { |
28 errorCode = error.code; | 28 errorName = error.name; |
29 shouldBe("FileError.ENCODING_ERR", "errorCode"); | 29 shouldBe('"EncodingError"', "errorName"); |
30 cleanupAndRunNext(); | 30 cleanupAndRunNext(); |
31 } | 31 } |
32 | 32 |
33 function createTestFile(callback) { | 33 function createTestFile(callback) { |
34 fileSystem.root.getFile(testFileName, {create:true}, callback, errorCallback
); | 34 fileSystem.root.getFile(testFileName, {create:true}, callback, errorCallback
); |
35 } | 35 } |
36 | 36 |
37 function assertPathsMatch(expected, actual) { | 37 function assertPathsMatch(expected, actual) { |
38 expectedPath = expected; | 38 expectedPath = expected; |
39 actualPath = actual; | 39 actualPath = actual; |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 cleanupAndRunNext(); | 197 cleanupAndRunNext(); |
198 } | 198 } |
199 | 199 |
200 if (this.webkitRequestFileSystem) { | 200 if (this.webkitRequestFileSystem) { |
201 jsTestIsAsync = true; | 201 jsTestIsAsync = true; |
202 webkitRequestFileSystem(this.TEMPORARY, 100, fileSystemCallback, errorCallba
ck); | 202 webkitRequestFileSystem(this.TEMPORARY, 100, fileSystemCallback, errorCallba
ck); |
203 } else | 203 } else |
204 debug("This test requires FileSystem API support."); | 204 debug("This test requires FileSystem API support."); |
205 | 205 |
206 var successfullyParsed = true; | 206 var successfullyParsed = true; |
OLD | NEW |