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

Side by Side Diff: components/storage_monitor/test_portable_device_watcher_win.h

Issue 1056633004: Update {virtual,override} to follow C++11 style in components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix logo tracker unittest. Created 5 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 PortableDeviceWatcherWin to expose some 5 // This file contains a subclass of PortableDeviceWatcherWin to expose some
6 // functionality for testing. 6 // functionality for testing.
7 7
8 #ifndef COMPONENTS_STORAGE_MONITOR_TEST_PORTABLE_DEVICE_WATCHER_WIN_H_ 8 #ifndef COMPONENTS_STORAGE_MONITOR_TEST_PORTABLE_DEVICE_WATCHER_WIN_H_
9 #define COMPONENTS_STORAGE_MONITOR_TEST_PORTABLE_DEVICE_WATCHER_WIN_H_ 9 #define COMPONENTS_STORAGE_MONITOR_TEST_PORTABLE_DEVICE_WATCHER_WIN_H_
10 10
11 #include <string> 11 #include <string>
12 12
13 #include "base/strings/string16.h" 13 #include "base/strings/string16.h"
14 #include "components/storage_monitor/portable_device_watcher_win.h" 14 #include "components/storage_monitor/portable_device_watcher_win.h"
15 15
16 namespace storage_monitor { 16 namespace storage_monitor {
17 17
18 class TestPortableDeviceWatcherWin : public PortableDeviceWatcherWin { 18 class TestPortableDeviceWatcherWin : public PortableDeviceWatcherWin {
19 public: 19 public:
20 // MTP device PnP identifiers. 20 // MTP device PnP identifiers.
21 static const base::char16 kMTPDeviceWithMultipleStorages[]; 21 static const base::char16 kMTPDeviceWithMultipleStorages[];
22 static const base::char16 kMTPDeviceWithInvalidInfo[]; 22 static const base::char16 kMTPDeviceWithInvalidInfo[];
23 static const base::char16 kMTPDeviceWithValidInfo[]; 23 static const base::char16 kMTPDeviceWithValidInfo[];
24 24
25 // MTP device storage unique identifier. 25 // MTP device storage unique identifier.
26 static const char kStorageUniqueIdA[]; 26 static const char kStorageUniqueIdA[];
27 27
28 TestPortableDeviceWatcherWin(); 28 TestPortableDeviceWatcherWin();
29 virtual ~TestPortableDeviceWatcherWin(); 29 ~TestPortableDeviceWatcherWin() override;
30 30
31 // Returns the persistent storage unique id of the device specified by the 31 // Returns the persistent storage unique id of the device specified by the
32 // |pnp_device_id|. |storage_object_id| specifies the string ID that uniquely 32 // |pnp_device_id|. |storage_object_id| specifies the string ID that uniquely
33 // identifies the object on the device. 33 // identifies the object on the device.
34 static std::string GetMTPStorageUniqueId( 34 static std::string GetMTPStorageUniqueId(
35 const base::string16& pnp_device_id, 35 const base::string16& pnp_device_id,
36 const base::string16& storage_object_id); 36 const base::string16& storage_object_id);
37 37
38 // Returns a list of storage object identifiers of the media transfer protocol 38 // Returns a list of storage object identifiers of the media transfer protocol
39 // (MTP) device given a |pnp_device_id|. 39 // (MTP) device given a |pnp_device_id|.
(...skipping 13 matching lines...) Expand all
53 static PortableDeviceWatcherWin::StorageObjects GetDeviceStorageObjects( 53 static PortableDeviceWatcherWin::StorageObjects GetDeviceStorageObjects(
54 const base::string16& pnp_device_id); 54 const base::string16& pnp_device_id);
55 55
56 // Used by MediaFileSystemRegistry unit test. 56 // Used by MediaFileSystemRegistry unit test.
57 void set_use_dummy_mtp_storage_info(bool use_dummy_info) { 57 void set_use_dummy_mtp_storage_info(bool use_dummy_info) {
58 use_dummy_mtp_storage_info_ = use_dummy_info; 58 use_dummy_mtp_storage_info_ = use_dummy_info;
59 } 59 }
60 60
61 private: 61 private:
62 // PortableDeviceWatcherWin: 62 // PortableDeviceWatcherWin:
63 virtual void EnumerateAttachedDevices() override; 63 void EnumerateAttachedDevices() override;
64 virtual void HandleDeviceAttachEvent( 64 void HandleDeviceAttachEvent(const base::string16& pnp_device_id) override;
65 const base::string16& pnp_device_id) override; 65 bool GetMTPStorageInfoFromDeviceId(
66 virtual bool GetMTPStorageInfoFromDeviceId(
67 const std::string& storage_device_id, 66 const std::string& storage_device_id,
68 base::string16* device_location, 67 base::string16* device_location,
69 base::string16* storage_object_id) const override; 68 base::string16* storage_object_id) const override;
70 69
71 // Set to true to get dummy storage details from 70 // Set to true to get dummy storage details from
72 // GetMTPStorageInfoFromDeviceId(). 71 // GetMTPStorageInfoFromDeviceId().
73 bool use_dummy_mtp_storage_info_; 72 bool use_dummy_mtp_storage_info_;
74 73
75 DISALLOW_COPY_AND_ASSIGN(TestPortableDeviceWatcherWin); 74 DISALLOW_COPY_AND_ASSIGN(TestPortableDeviceWatcherWin);
76 }; 75 };
77 76
78 } // namespace storage_monitor 77 } // namespace storage_monitor
79 78
80 #endif // COMPONENTS_STORAGE_MONITOR_TEST_PORTABLE_DEVICE_WATCHER_WIN_H_ 79 #endif // COMPONENTS_STORAGE_MONITOR_TEST_PORTABLE_DEVICE_WATCHER_WIN_H_
OLDNEW
« no previous file with comments | « components/storage_monitor/storage_monitor_win_unittest.cc ('k') | components/storage_monitor/test_storage_monitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698