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

Unified Diff: chrome/test/data/extensions/api_test/file_system_provider/get_metadata/test.js

Issue 329483002: [fsp] Group arguments for API methods and events in dictionaries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleaned up. Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/file_system_provider/get_metadata/test.js
diff --git a/chrome/test/data/extensions/api_test/file_system_provider/get_metadata/test.js b/chrome/test/data/extensions/api_test/file_system_provider/get_metadata/test.js
index 4cc007c1f03fdfa3457ae5e0ab119fe59064fd1c..2dd95a284a1d5c5b0f5cde724dc5d5b469c87085 100644
--- a/chrome/test/data/extensions/api_test/file_system_provider/get_metadata/test.js
+++ b/chrome/test/data/extensions/api_test/file_system_provider/get_metadata/test.js
@@ -71,29 +71,28 @@ function getVolumeInfo(fileSystemId, callback) {
/**
* Returns metadata for a requested entry.
*
- * @param {string} inFileSystemId ID of the file system.
- * @param {string} entryPath Path of the requested entry.
+ * @param {GetMetadataRequestedOptions} options Options.
* @param {function(Object)} onSuccess Success callback with metadata passed
* an argument.
* @param {function(string)} onError Error callback with an error code.
*/
-function onGetMetadataRequested(inFileSystemId, entryPath, onSuccess, onError) {
- if (inFileSystemId != FILE_SYSTEM_ID) {
- onError('SECURITY_ERROR'); // enum ProviderError.
+function onGetMetadataRequested(options, onSuccess, onError) {
+ if (options.fileSystemId != FILE_SYSTEM_ID) {
+ onError('SECURITY'); // enum ProviderError.
return;
}
- if (entryPath == '/') {
+ if (options.entryPath == '/') {
onSuccess(TESTING_ROOT);
return;
}
- if (entryPath == '/' + TESTING_FILE.name) {
+ if (options.entryPath == '/' + TESTING_FILE.name) {
onSuccess(TESTING_FILE);
return;
}
- if (entryPath == '/' + TESTING_WRONG_TIME_FILE.name) {
+ if (options.entryPath == '/' + TESTING_WRONG_TIME_FILE.name) {
onSuccess(TESTING_WRONG_TIME_FILE);
return;
}
@@ -108,24 +107,27 @@ function onGetMetadataRequested(inFileSystemId, entryPath, onSuccess, onError) {
* @param {function()} callback Success callback.
*/
function setUp(callback) {
- chrome.fileSystemProvider.mount(FILE_SYSTEM_ID, 'chocolate.zip', function() {
- chrome.fileSystemProvider.onGetMetadataRequested.addListener(
- onGetMetadataRequested);
-
- getVolumeInfo(FILE_SYSTEM_ID, function(volumeInfo) {
- chrome.test.assertTrue(!!volumeInfo);
- chrome.fileBrowserPrivate.requestFileSystem(
- volumeInfo.volumeId,
- function(inFileSystem) {
- chrome.test.assertTrue(!!inFileSystem);
-
- fileSystem = inFileSystem;
- callback();
- });
- });
- }, function() {
- chrome.test.fail();
- });
+ chrome.fileSystemProvider.mount(
+ {fileSystemId: FILE_SYSTEM_ID, displayName: 'chocolate.zip'},
+ function() {
+ chrome.fileSystemProvider.onGetMetadataRequested.addListener(
+ onGetMetadataRequested);
+
+ getVolumeInfo(FILE_SYSTEM_ID, function(volumeInfo) {
+ chrome.test.assertTrue(!!volumeInfo);
+ chrome.fileBrowserPrivate.requestFileSystem(
+ volumeInfo.volumeId,
+ function(inFileSystem) {
+ chrome.test.assertTrue(!!inFileSystem);
+
+ fileSystem = inFileSystem;
+ callback();
+ });
+ });
+ },
+ function() {
+ chrome.test.fail();
+ });
}
/**

Powered by Google App Engine
This is Rietveld 408576698