OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // This file contains a subclass of VolumeMountWatcherWin to expose some | 5 // This file contains a subclass of VolumeMountWatcherWin to expose some |
6 // functionality for testing. | 6 // functionality for testing. |
7 | 7 |
8 #ifndef CHROME_BROWSER_STORAGE_MONITOR_TEST_VOLUME_MOUNT_WATCHER_WIN_H_ | 8 #ifndef CHROME_BROWSER_STORAGE_MONITOR_TEST_VOLUME_MOUNT_WATCHER_WIN_H_ |
9 #define CHROME_BROWSER_STORAGE_MONITOR_TEST_VOLUME_MOUNT_WATCHER_WIN_H_ | 9 #define CHROME_BROWSER_STORAGE_MONITOR_TEST_VOLUME_MOUNT_WATCHER_WIN_H_ |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
15 #include "base/synchronization/waitable_event.h" | 15 #include "base/synchronization/waitable_event.h" |
16 #include "chrome/browser/storage_monitor/volume_mount_watcher_win.h" | 16 #include "chrome/browser/storage_monitor/volume_mount_watcher_win.h" |
17 | 17 |
18 namespace base { | 18 namespace base { |
19 class FilePath; | 19 class FilePath; |
20 } | 20 } |
21 | 21 |
22 namespace chrome { | |
23 namespace test { | |
24 | |
25 class TestVolumeMountWatcherWin : public VolumeMountWatcherWin { | 22 class TestVolumeMountWatcherWin : public VolumeMountWatcherWin { |
26 public: | 23 public: |
27 TestVolumeMountWatcherWin(); | 24 TestVolumeMountWatcherWin(); |
28 virtual ~TestVolumeMountWatcherWin(); | 25 virtual ~TestVolumeMountWatcherWin(); |
29 | 26 |
30 static bool GetDeviceRemovable(const base::FilePath& device_path, | 27 static bool GetDeviceRemovable(const base::FilePath& device_path, |
31 bool* removable); | 28 bool* removable); |
32 | 29 |
33 void AddDeviceForTesting(const base::FilePath& device_path, | 30 void AddDeviceForTesting(const base::FilePath& device_path, |
34 const std::string& device_id, | 31 const std::string& device_id, |
(...skipping 25 matching lines...) Expand all Loading... |
60 void ShutdownWorkerPool(); | 57 void ShutdownWorkerPool(); |
61 | 58 |
62 private: | 59 private: |
63 std::vector<base::FilePath> devices_checked_; | 60 std::vector<base::FilePath> devices_checked_; |
64 scoped_ptr<base::WaitableEvent> device_check_complete_event_; | 61 scoped_ptr<base::WaitableEvent> device_check_complete_event_; |
65 bool attached_devices_fake_; | 62 bool attached_devices_fake_; |
66 | 63 |
67 DISALLOW_COPY_AND_ASSIGN(TestVolumeMountWatcherWin); | 64 DISALLOW_COPY_AND_ASSIGN(TestVolumeMountWatcherWin); |
68 }; | 65 }; |
69 | 66 |
70 } // namespace test | |
71 } // namespace chrome | |
72 | |
73 #endif // CHROME_BROWSER_STORAGE_MONITOR_TEST_VOLUME_MOUNT_WATCHER_WIN_H_ | 67 #endif // CHROME_BROWSER_STORAGE_MONITOR_TEST_VOLUME_MOUNT_WATCHER_WIN_H_ |
OLD | NEW |