OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 'use strict'; | 5 'use strict'; |
6 | 6 |
7 var fileSystemId; | 7 var fileSystemId; |
8 var fileSystem; | 8 var fileSystem; |
9 | 9 |
10 /** | 10 /** |
(...skipping 18 matching lines...) Expand all Loading... |
29 modificationTime: new Date(2014, 4, 28, 10, 39, 15) | 29 modificationTime: new Date(2014, 4, 28, 10, 39, 15) |
30 }); | 30 }); |
31 | 31 |
32 /** | 32 /** |
33 * Returns metadata for a requested entry. | 33 * Returns metadata for a requested entry. |
34 * | 34 * |
35 * @param {number} inFileSystemId ID of the file system. | 35 * @param {number} inFileSystemId ID of the file system. |
36 * @param {string} entryPath Path of the requested entry. | 36 * @param {string} entryPath Path of the requested entry. |
37 * @param {function(Object)} onSuccess Success callback with metadata passed | 37 * @param {function(Object)} onSuccess Success callback with metadata passed |
38 * an argument. | 38 * an argument. |
39 * @param {function(string}} onError Error callback with an error code. | 39 * @param {function(string)} onError Error callback with an error code. |
40 */ | 40 */ |
41 function onGetMetadataRequested( | 41 function onGetMetadataRequested( |
42 inFileSystemId, entryPath, onSuccess, onError) { | 42 inFileSystemId, entryPath, onSuccess, onError) { |
43 if (inFileSystemId != fileSystemId) { | 43 if (inFileSystemId != fileSystemId) { |
44 onError('SECURITY_ERROR'); // enum ProviderError. | 44 onError('SECURITY_ERROR'); // enum ProviderError. |
45 return; | 45 return; |
46 } | 46 } |
47 | 47 |
48 if (entryPath == '/') { | 48 if (entryPath == '/') { |
49 onSuccess(TESTING_ROOT); | 49 onSuccess(TESTING_ROOT); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 function(error) { | 157 function(error) { |
158 chrome.test.assertEq('TypeMismatchError', error.name); | 158 chrome.test.assertEq('TypeMismatchError', error.name); |
159 onSuccess(); | 159 onSuccess(); |
160 }); | 160 }); |
161 } | 161 } |
162 ]); | 162 ]); |
163 } | 163 } |
164 | 164 |
165 // Setup and run all of the test cases. | 165 // Setup and run all of the test cases. |
166 setUp(runTests); | 166 setUp(runTests); |
OLD | NEW |