OLD | NEW |
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/stl_util.h" | 5 #include "base/stl_util.h" |
| 6 #include "chrome/browser/chromeos/file_manager/drive_test_util.h" |
6 #include "chrome/browser/extensions/extension_apitest.h" | 7 #include "chrome/browser/extensions/extension_apitest.h" |
7 #include "chromeos/dbus/cros_disks_client.h" | 8 #include "chromeos/dbus/cros_disks_client.h" |
8 #include "chromeos/disks/mock_disk_mount_manager.h" | 9 #include "chromeos/disks/mock_disk_mount_manager.h" |
9 | 10 |
10 using ::testing::_; | 11 using ::testing::_; |
11 using ::testing::ReturnRef; | 12 using ::testing::ReturnRef; |
12 | 13 |
13 using chromeos::disks::DiskMountManager; | 14 using chromeos::disks::DiskMountManager; |
14 | 15 |
15 namespace { | 16 namespace { |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 return (volume_it == volumes_.end()) ? NULL : volume_it->second; | 228 return (volume_it == volumes_.end()) ? NULL : volume_it->second; |
228 } | 229 } |
229 | 230 |
230 protected: | 231 protected: |
231 chromeos::disks::MockDiskMountManager* disk_mount_manager_mock_; | 232 chromeos::disks::MockDiskMountManager* disk_mount_manager_mock_; |
232 DiskMountManager::DiskMap volumes_; | 233 DiskMountManager::DiskMap volumes_; |
233 DiskMountManager::MountPointMap mount_points_; | 234 DiskMountManager::MountPointMap mount_points_; |
234 }; | 235 }; |
235 | 236 |
236 IN_PROC_BROWSER_TEST_F(FileBrowserPrivateApiTest, Mount) { | 237 IN_PROC_BROWSER_TEST_F(FileBrowserPrivateApiTest, Mount) { |
| 238 file_manager::test_util::WaitUntilDriveMountPointIsAdded( |
| 239 browser()->profile()); |
| 240 |
237 // We will call fileBrowserPrivate.unmountVolume once. To test that method, we | 241 // We will call fileBrowserPrivate.unmountVolume once. To test that method, we |
238 // check that UnmountPath is really called with the same value. | 242 // check that UnmountPath is really called with the same value. |
239 EXPECT_CALL(*disk_mount_manager_mock_, UnmountPath(_, _, _)) | 243 EXPECT_CALL(*disk_mount_manager_mock_, UnmountPath(_, _, _)) |
240 .Times(0); | 244 .Times(0); |
241 EXPECT_CALL(*disk_mount_manager_mock_, | 245 EXPECT_CALL(*disk_mount_manager_mock_, |
242 UnmountPath( | 246 UnmountPath( |
243 chromeos::CrosDisksClient::GetArchiveMountPoint().AppendASCII( | 247 chromeos::CrosDisksClient::GetArchiveMountPoint().AppendASCII( |
244 "archive_mount_path").AsUTF8Unsafe(), | 248 "archive_mount_path").AsUTF8Unsafe(), |
245 chromeos::UNMOUNT_OPTIONS_NONE, _)).Times(1); | 249 chromeos::UNMOUNT_OPTIONS_NONE, _)).Times(1); |
246 | 250 |
247 EXPECT_CALL(*disk_mount_manager_mock_, disks()) | 251 EXPECT_CALL(*disk_mount_manager_mock_, disks()) |
248 .WillRepeatedly(ReturnRef(volumes_)); | 252 .WillRepeatedly(ReturnRef(volumes_)); |
249 | 253 |
250 EXPECT_CALL(*disk_mount_manager_mock_, mount_points()) | 254 EXPECT_CALL(*disk_mount_manager_mock_, mount_points()) |
251 .WillRepeatedly(ReturnRef(mount_points_)); | 255 .WillRepeatedly(ReturnRef(mount_points_)); |
252 | 256 |
253 ASSERT_TRUE(RunComponentExtensionTest("file_browser/mount_test")) | 257 ASSERT_TRUE(RunComponentExtensionTest("file_browser/mount_test")) |
254 << message_; | 258 << message_; |
255 } | 259 } |
OLD | NEW |