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

Side by Side Diff: chrome/test/data/extensions/api_test/file_system_provider/evil/test.js

Issue 379743003: [fsp] Remove the create flag from the file opening operation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 // 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
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
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);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698