OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/chromeos/cros/mock_mount_library.h" | 5 #include "chrome/browser/chromeos/cros/mock_mount_library.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "chrome/browser/chromeos/cros/cros_library.h" | 9 #include "chrome/browser/chromeos/cros/cros_library.h" |
10 #include "content/browser/browser_thread.h" | 10 #include "content/browser/browser_thread.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 EXPECT_CALL(*this, RemoveObserver(_)) | 125 EXPECT_CALL(*this, RemoveObserver(_)) |
126 .Times(AnyNumber()); | 126 .Times(AnyNumber()); |
127 EXPECT_CALL(*this, disks()) | 127 EXPECT_CALL(*this, disks()) |
128 .WillRepeatedly(ReturnRef(disks_)); | 128 .WillRepeatedly(ReturnRef(disks_)); |
129 EXPECT_CALL(*this, RequestMountInfoRefresh()) | 129 EXPECT_CALL(*this, RequestMountInfoRefresh()) |
130 .Times(AnyNumber()); | 130 .Times(AnyNumber()); |
131 EXPECT_CALL(*this, MountPath(_, _, _)) | 131 EXPECT_CALL(*this, MountPath(_, _, _)) |
132 .Times(AnyNumber()); | 132 .Times(AnyNumber()); |
133 EXPECT_CALL(*this, UnmountPath(_)) | 133 EXPECT_CALL(*this, UnmountPath(_)) |
134 .Times(AnyNumber()); | 134 .Times(AnyNumber()); |
135 EXPECT_CALL(*this, FormatUnmountedDevice(_)) | |
136 .Times(AnyNumber()); | |
137 EXPECT_CALL(*this, FormatMountedDevice(_)) | |
138 .Times(AnyNumber()); | |
139 EXPECT_CALL(*this, UnmountDeviceRecursive(_, _, _)) | 135 EXPECT_CALL(*this, UnmountDeviceRecursive(_, _, _)) |
140 .Times(AnyNumber()); | 136 .Times(AnyNumber()); |
141 } | 137 } |
142 | 138 |
143 void MockMountLibrary::UpdateDiskChanged(MountLibraryEventType evt, | 139 void MockMountLibrary::UpdateDiskChanged(MountLibraryEventType evt, |
144 const MountLibrary::Disk* disk) { | 140 const MountLibrary::Disk* disk) { |
145 // Make sure we run on UI thread. | 141 // Make sure we run on UI thread. |
146 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 142 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
147 | 143 |
148 FOR_EACH_OBSERVER(Observer, observers_, DiskChanged(evt, disk)); | 144 FOR_EACH_OBSERVER(Observer, observers_, DiskChanged(evt, disk)); |
149 } | 145 } |
150 | 146 |
151 | 147 |
152 void MockMountLibrary::UpdateDeviceChanged(MountLibraryEventType evt, | 148 void MockMountLibrary::UpdateDeviceChanged(MountLibraryEventType evt, |
153 const std::string& path) { | 149 const std::string& path) { |
154 // Make sure we run on UI thread. | 150 // Make sure we run on UI thread. |
155 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 151 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
156 | 152 |
157 FOR_EACH_OBSERVER(Observer, observers_, DeviceChanged(evt, path)); | 153 FOR_EACH_OBSERVER(Observer, observers_, DeviceChanged(evt, path)); |
158 } | 154 } |
159 | 155 |
160 } // namespace chromeos | 156 } // namespace chromeos |
OLD | NEW |