diff options
author | yoshiki@chromium.org <yoshiki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-08 07:18:27 +0000 |
---|---|---|
committer | yoshiki@chromium.org <yoshiki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-08 07:18:27 +0000 |
commit | f5bf2a0f7fac0163f75e108cd35c9f33193cd29b (patch) | |
tree | 5dc1f1dd7eee8bded25ba5a56e9ae93e17dba276 | |
parent | 68a9b0d8350125aee0404c569723bbeb56f7e0ac (diff) | |
download | chromium_src-f5bf2a0f7fac0163f75e108cd35c9f33193cd29b.zip chromium_src-f5bf2a0f7fac0163f75e108cd35c9f33193cd29b.tar.gz chromium_src-f5bf2a0f7fac0163f75e108cd35c9f33193cd29b.tar.bz2 |
Files.app: add missing mock methods in mock_chrome.js
BUG=none
TEST=none
R=mtomasz@chromium.org
NOTRY=True
Review URL: https://chromiumcodereview.appspot.com/12683002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186910 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/resources/file_manager/js/mock_chrome.js | 142 |
1 files changed, 136 insertions, 6 deletions
diff --git a/chrome/browser/resources/file_manager/js/mock_chrome.js b/chrome/browser/resources/file_manager/js/mock_chrome.js index 8e7f58b..23cba52 100644 --- a/chrome/browser/resources/file_manager/js/mock_chrome.js +++ b/chrome/browser/resources/file_manager/js/mock_chrome.js @@ -409,11 +409,20 @@ chrome.fileBrowserPrivate = { onPreferencesChanged: new MockEventSource(), + /** + * Retrieves file manager preferencves. + * + * @param {function(Object.<string, boolean>)} callback Return the result + */ getPreferences: function(callback) { setTimeout(callback, 0, cloneShallow( - chrome.fileBrowserPrivate.drivePreferences_)); + chrome.fileBrowserPrivate.preferences_)); }, + /** + * Sets fuke nabager preferences. + * @param {Object.<string, boolean>} preferences Preferences. + */ setPreferences: function(preferences) { for (var prop in preferences) { chrome.fileBrowserPrivate.preferences_[prop] = preferences[prop]; @@ -421,21 +430,25 @@ chrome.fileBrowserPrivate = { chrome.fileBrowserPrivate.onPreferencesChanged.notify(); }, - networkConnectionState_: { - type: 'cellular', + driveConnectionState_: { + type: 'metered', online: true }, onDriveConnectionStatusChanged: new MockEventSource(), + /** + * Retrieves the state of the current drive connection. + * @param {function(Object)} callback Callback + */ getDriveConnectionState: function(callback) { setTimeout(callback, 0, cloneShallow( - chrome.fileBrowserPrivate.networkConnectionState_)); + chrome.fileBrowserPrivate.driveConnectionState_)); }, setConnectionState_: function(state) { - chrome.fileBrowserPrivate.networkConnectionState_ = state; - chrome.fileBrowserPrivate.onNetworkConnectionChanged.notify(); + chrome.fileBrowserPrivate.driveConnectionState_ = state; + chrome.fileBrowserPrivate.onDriveConnectionStatusChanged.notify(); }, pinDriveFile: function(urls, on, callback) { @@ -778,7 +791,117 @@ chrome.fileBrowserPrivate = { THUMBNAIL_VIEW_TOOLTIP: 'Thumbnail view', textdirection: '' }); + }, + + /** + * Checks whether the path name length fits in the limit of the filesystem. + * + * @param {string} parent_directory_url The URL of the parent directory entry. + * @param {string} name The name of the file. + * @param {function(boolean)} callback true if the length is in the valid + * range, false otherwise. + */ + validatePathNameLength: function(parent_directory_url, name, callback) { + callback(true); + }, + + /** + * Logout the current user. + */ + logoutUser: function() {}, + + onFileTransfersUpdated: new MockEventSource(), + + /** + * Sets the default task for the supplied MIME types and suffixes of the + * supplied file URLs. Lists of MIME types and URLs may contain duplicates. + * + * @param {string} taskId The unique identifier of task to mark as default. + * @param {Array.<string>} fileURLs Array of selected file URLs to extract + * suffixes from. + * @param {Array.<string>=} opt_mimeTypes Array of selected file MIME types. + * @param {function()=} opt_callback Returns The list of matched file URL + * patterns for this task. + */ + setDefaultTask: function(taskId, fileURLs, opt_mimeTypes, opt_callback) { + if (opt_callback) + opt_callback(); + }, + + /** + * Get Drive files + * @param {Array.<string>} array Array of Drive file URLs to get. + * @param {function(Array.<string>)} callback Returns the local file pathes. + */ + getDriveFiles: function(array, callback) { + callback([]); + }, + + /* + * Cancels ongoing file transfers for selected files. + * @param {Array.<string>} array Array of files for which ongoing transfer + * should be canceled. + * @param {function(Array.<FileTransferCancelStatus>)} callback Return the + * list of FileTransferCancelStatus. + */ + cancelFileTransfers: function(array, callback) { + callback([]); + }, + + /** + * Performs drive metadata search. + * @param {string} searchQuery Search query. + * @param {function(Array.<Object>)} callback Callback + */ + searchDriveMetadata: function(searchQuery, callback) { + callback([]); + }, + + /** + * Formats a mounted device. + * @param {string} mountPath Device's mount path. + */ + formatDevice: function(mountPath) {}, + + /** + * Opens a new window of the Files.app. + * @param {string} url Internal url to be opened. + */ + openNewWindow: function(url) {}, + + /** + * Clear all Drive local caches. + */ + clearDriveCache: function() {}, + + /** + * Reload the filesystem metadata from the server immediately. + */ + reloadDrive: function() {}, + + /** + * Get the list of mount points. + * @param {function(Array.<MountPointInfo>)} callback Callback + */ + getMountPoints: function(callback) { + callback([]); + }, + + /** + * Requests a refresh of a directory. + * @param {string} fileURL URL of the target directory. + */ + requestDirectoryRefresh: function(fileURL) {}, + + /** + * Performs drive content search. + * @param {Object} searchParams Param of the search + * @param {function(Array.<Object>)} searchCallback Callback + */ + searchDrive: function(searchParams, searchCallback) { + searchCallback([]); } + }; /** @@ -803,6 +926,13 @@ chrome.extension = { getViews: function() { return [window]; + }, + + /** + * Attempts to connect to other listeners within the app. + * @param {string=} extensionId The ID of the app you want to connect to. + */ + connect: function(extensionId) { } }; |