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

Side by Side Diff: chrome/browser/system_monitor/removable_storage_notifications_unittest.cc

Issue 11573048: [Media Galleries] Move RemovableStorageInfo notifications to chrome namespace (part 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make singleton pointer live in base class. Created 7 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "base/message_loop.h" 5 #include "base/message_loop.h"
6 #include "base/system_monitor/system_monitor.h" 6 #include "base/system_monitor/system_monitor.h"
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/system_monitor/mock_removable_storage_observer.h" 8 #include "chrome/browser/system_monitor/mock_removable_storage_observer.h"
9 #include "chrome/browser/system_monitor/removable_storage_notifications.h" 9 #include "chrome/browser/system_monitor/removable_storage_notifications.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 namespace chrome { 12 namespace chrome {
13 13
14 class TestStorageNotifications : public RemovableStorageNotifications { 14 class TestStorageNotifications : public RemovableStorageNotifications {
15 public: 15 public:
16 TestStorageNotifications() { 16 TestStorageNotifications() {
17 } 17 }
18 18
19 ~TestStorageNotifications() {} 19 ~TestStorageNotifications() {}
20 20
21 virtual bool GetDeviceInfoForPath( 21 virtual bool GetDeviceInfoForPath(
22 const FilePath& path, 22 const FilePath& path,
23 base::SystemMonitor::RemovableStorageInfo* device_info) const OVERRIDE { 23 StorageInfo* device_info) const OVERRIDE {
24 return false; 24 return false;
25 } 25 }
26 virtual uint64 GetStorageSize(const std::string& location) const OVERRIDE { 26 virtual uint64 GetStorageSize(const std::string& location) const OVERRIDE {
27 return 0; 27 return 0;
28 } 28 }
29 29
30 void ProcessAttach(const std::string& id, 30 void ProcessAttach(const std::string& id,
31 const string16& name, 31 const string16& name,
32 const FilePath::StringType& location) { 32 const FilePath::StringType& location) {
33 RemovableStorageNotifications::ProcessAttach(id, name, location); 33 RemovableStorageNotifications::ProcessAttach(id, name, location);
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 EXPECT_EQ(kDeviceName2, devices[0].name); 131 EXPECT_EQ(kDeviceName2, devices[0].name);
132 EXPECT_EQ(kDevicePath2.value(), devices[0].location); 132 EXPECT_EQ(kDevicePath2.value(), devices[0].location);
133 133
134 notifications.ProcessDetach(kDeviceId2); 134 notifications.ProcessDetach(kDeviceId2);
135 message_loop.RunUntilIdle(); 135 message_loop.RunUntilIdle();
136 devices = notifications.GetAttachedStorage(); 136 devices = notifications.GetAttachedStorage();
137 EXPECT_EQ(0U, devices.size()); 137 EXPECT_EQ(0U, devices.size());
138 } 138 }
139 139
140 } // namespace chrome 140 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698