Fix build break
[chromium-blink-merge.git] / chrome / browser / storage_monitor / test_volume_mount_watcher_win.h
blob09ed62b55382bc5dec45f9022f8089baf52b3b59
1 // Copyright (c) 2013 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 VolumeMountWatcherWin to expose some
6 // functionality for testing.
8 #ifndef CHROME_BROWSER_STORAGE_MONITOR_TEST_VOLUME_MOUNT_WATCHER_WIN_H_
9 #define CHROME_BROWSER_STORAGE_MONITOR_TEST_VOLUME_MOUNT_WATCHER_WIN_H_
11 #include <string>
12 #include <vector>
14 #include "base/string16.h"
15 #include "base/synchronization/waitable_event.h"
16 #include "chrome/browser/storage_monitor/volume_mount_watcher_win.h"
18 namespace base {
19 class FilePath;
22 namespace chrome {
23 namespace test {
25 class TestVolumeMountWatcherWin : public VolumeMountWatcherWin {
26 public:
27 TestVolumeMountWatcherWin();
28 virtual ~TestVolumeMountWatcherWin();
30 void AddDeviceForTesting(const base::FilePath& device_path,
31 const std::string& device_id,
32 const std::string& unique_id,
33 const string16& device_name,
34 bool removable,
35 uint64 total_size_in_bytes);
37 void SetAttachedDevicesFake();
39 void FlushWorkerPoolForTesting();
41 virtual void DeviceCheckComplete(const base::FilePath& device_path);
43 std::vector<base::FilePath> devices_checked() const {
44 return devices_checked_;
47 void BlockDeviceCheckForTesting();
49 void ReleaseDeviceCheck();
51 // VolumeMountWatcherWin:
53 virtual GetAttachedDevicesCallbackType
54 GetAttachedDevicesCallback() const OVERRIDE;
55 virtual GetDeviceDetailsCallbackType
56 GetDeviceDetailsCallback() const OVERRIDE;
58 // Should be used by unit tests to make sure the worker pool doesn't survive
59 // into other test runs.
60 void ShutdownWorkerPool();
62 private:
63 std::vector<base::FilePath> devices_checked_;
64 scoped_ptr<base::WaitableEvent> device_check_complete_event_;
65 bool attached_devices_fake_;
67 DISALLOW_COPY_AND_ASSIGN(TestVolumeMountWatcherWin);
70 } // namespace test
71 } // namespace chrome
73 #endif // CHROME_BROWSER_STORAGE_MONITOR_TEST_VOLUME_MOUNT_WATCHER_WIN_H_