| 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 /** | 7 /** |
| 8 * @type {DOMFileSystem} | 8 * @type {DOMFileSystem} |
| 9 */ | 9 */ |
| 10 var fileSystem = null; | 10 var fileSystem = null; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 * @param {OpenFileRequestedOptions} options Options. | 71 * @param {OpenFileRequestedOptions} options Options. |
| 72 * @param {function()} onSuccess Success callback. | 72 * @param {function()} onSuccess Success callback. |
| 73 * @param {function(string)} onError Error callback. | 73 * @param {function(string)} onError Error callback. |
| 74 */ | 74 */ |
| 75 function onOpenFileRequested(options, onSuccess, onError) { | 75 function onOpenFileRequested(options, onSuccess, onError) { |
| 76 if (options.fileSystemId != test_util.FILE_SYSTEM_ID) { | 76 if (options.fileSystemId != test_util.FILE_SYSTEM_ID) { |
| 77 onError('INVALID_OPERATION'); // enum ProviderError. | 77 onError('INVALID_OPERATION'); // enum ProviderError. |
| 78 return; | 78 return; |
| 79 } | 79 } |
| 80 | 80 |
| 81 if (options.mode != 'READ' || options.create) { | 81 if (options.mode != 'READ') { |
| 82 onError('ACCESS_DENIED'); // enum ProviderError. | 82 onError('ACCESS_DENIED'); // enum ProviderError. |
| 83 return; | 83 return; |
| 84 } | 84 } |
| 85 | 85 |
| 86 if (options.filePath != '/' + TESTING_TOO_LARGE_CHUNK_FILE.name || | 86 if (options.filePath != '/' + TESTING_TOO_LARGE_CHUNK_FILE.name || |
| 87 options.filePath != '/' + TESTING_INVALID_CALLBACK_FILE.name || | 87 options.filePath != '/' + TESTING_INVALID_CALLBACK_FILE.name || |
| 88 options.filePath != '/' + TESTING_NEGATIVE_SIZE_FILE.name || | 88 options.filePath != '/' + TESTING_NEGATIVE_SIZE_FILE.name || |
| 89 options.filePath != '/' + TESTING_RELATIVE_NAME_FILE.name) { | 89 options.filePath != '/' + TESTING_RELATIVE_NAME_FILE.name) { |
| 90 onError('NOT_FOUND'); // enum ProviderError. | 90 onError('NOT_FOUND'); // enum ProviderError. |
| 91 return; | 91 return; |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 chrome.test.fail('Opening a file should fail.'); | 300 chrome.test.fail('Opening a file should fail.'); |
| 301 }, | 301 }, |
| 302 function(error) { | 302 function(error) { |
| 303 onTestSuccess(); | 303 onTestSuccess(); |
| 304 }); | 304 }); |
| 305 }, ]); | 305 }, ]); |
| 306 } | 306 } |
| 307 | 307 |
| 308 // Setup and run all of the test cases. | 308 // Setup and run all of the test cases. |
| 309 setUp(runTests); | 309 setUp(runTests); |
| OLD | NEW |