test_storage_monitor_win.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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
  3. // found in the LICENSE file.
  4. //
  5. // This file contains a subclass of StorageMonitorWin to simulate device
  6. // changed events for testing.
  7. #ifndef COMPONENTS_STORAGE_MONITOR_TEST_STORAGE_MONITOR_WIN_H_
  8. #define COMPONENTS_STORAGE_MONITOR_TEST_STORAGE_MONITOR_WIN_H_
  9. #include <windows.h>
  10. #include <memory>
  11. #include "base/memory/ref_counted.h"
  12. #include "components/storage_monitor/storage_monitor_win.h"
  13. namespace storage_monitor {
  14. class TestPortableDeviceWatcherWin;
  15. class TestVolumeMountWatcherWin;
  16. class TestStorageMonitorWin: public StorageMonitorWin {
  17. public:
  18. TestStorageMonitorWin(
  19. std::unique_ptr<TestVolumeMountWatcherWin> volume_mount_watcher,
  20. std::unique_ptr<TestPortableDeviceWatcherWin> portable_device_watcher);
  21. TestStorageMonitorWin(const TestStorageMonitorWin&) = delete;
  22. TestStorageMonitorWin& operator=(const TestStorageMonitorWin&) = delete;
  23. ~TestStorageMonitorWin() override;
  24. void InjectDeviceChange(UINT event_type, LPARAM data);
  25. VolumeMountWatcherWin* volume_mount_watcher();
  26. Receiver* receiver() const override;
  27. };
  28. } // namespace storage_monitor
  29. #endif // COMPONENTS_STORAGE_MONITOR_TEST_STORAGE_MONITOR_WIN_H_