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

Unified Diff: chrome/test/data/file_manager/unit_tests/mocks/mock_volume_manager.js

Issue 762593006: Prototype implementation of MediaImportHandler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync to master. Created 6 years 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/file_manager/unit_tests/mocks/mock_volume_manager.js
diff --git a/chrome/test/data/file_manager/unit_tests/mocks/mock_volume_manager.js b/chrome/test/data/file_manager/unit_tests/mocks/mock_volume_manager.js
index f47dec2e4ec1354da9e209d557e2a695b66f4f26..eeac5566cca8c7ddb5210707e36262e5e3cde8fc 100644
--- a/chrome/test/data/file_manager/unit_tests/mocks/mock_volume_manager.js
+++ b/chrome/test/data/file_manager/unit_tests/mocks/mock_volume_manager.js
@@ -18,6 +18,23 @@ function MockVolumeManager() {
}
/**
+ * @private {?VolumeManager}
+ */
+MockVolumeManager.instance_ = null;
+
+/**
+ * Replaces the VolumeManager singleton with a MockVolumeManager.
+ * @param {!MockVolumeManager=} opt_singleton
+ */
+MockVolumeManager.installMockSingleton = function(opt_singleton) {
+ MockVolumeManager.instance_ = opt_singleton || new MockVolumeManager();
+
+ VolumeManager.getInstance = function() {
+ return Promise.resolve(MockVolumeManager.instance_);
+ };
+};
+
+/**
* Returns the corresponding VolumeInfo.
*
* @param {MockFileEntry} entry MockFileEntry pointing anywhere on a volume.
@@ -55,6 +72,15 @@ MockVolumeManager.prototype.getLocationInfo = function(entry) {
};
/**
+ * @param {VolumeManagerCommon.VolumeType} volumeType Volume type.
+ * @return {VolumeInfo} Volume info.
+ */
+MockVolumeManager.prototype.getCurrentProfileVolumeInfo = function(volumeType) {
+ return VolumeManager.prototype.getCurrentProfileVolumeInfo.call(
+ this, volumeType);
+};
+
+/**
* Utility function to create a mock VolumeInfo.
* @param {VolumeType} type Volume type.
* @param {string} volumeId Volume id.

Powered by Google App Engine
This is Rietveld 408576698