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

Unified Diff: chrome/browser/extensions/api/image_writer_private/removable_storage_provider.h

Issue 266363006: Adds API tests for listRemovableStorageDevices (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resync. Created 6 years, 7 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/browser/extensions/api/image_writer_private/removable_storage_provider.h
diff --git a/chrome/browser/extensions/api/image_writer_private/removable_storage_provider.h b/chrome/browser/extensions/api/image_writer_private/removable_storage_provider.h
index 2fb6a39967767ab08617d8202e039b5867c49b4d..c0332a0c204a4df2fcc0eb48a3960910a7215c24 100644
--- a/chrome/browser/extensions/api/image_writer_private/removable_storage_provider.h
+++ b/chrome/browser/extensions/api/image_writer_private/removable_storage_provider.h
@@ -10,6 +10,8 @@
namespace extensions {
+// TODO(haven): Clean up this class to remove refcounting. http://crbug/370590
+
typedef RefCountedVector<linked_ptr
<api::image_writer_private::RemovableStorageDevice> > StorageDeviceList;
@@ -19,10 +21,21 @@ class RemovableStorageProvider {
public:
typedef base::Callback<void(scoped_refptr<StorageDeviceList>, bool)>
DeviceListReadyCallback;
+
+ // Gets the list of all available devices and returns it via callback.
static void GetAllDevices(DeviceListReadyCallback callback);
-#if defined(OS_LINUX)
- static bool GetDevicesOnFileThread(scoped_refptr<StorageDeviceList>);
-#endif
+
+ // Sets the list of devices that will be returned by GetAllDevices during
+ // testing. All calls to |GetAllDevices| will return this list until
+ // |ClearDeviceListForTesting| is called.
+ static void SetDeviceListForTesting(
+ scoped_refptr<StorageDeviceList> device_list);
+ // Clears the list of devices that is used during testing.
+ static void ClearDeviceListForTesting();
+
+ private:
+ // Fills the provided empty device list with the available devices.
+ static bool PopulateDeviceList(scoped_refptr<StorageDeviceList> device_list);
};
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698