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

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

Issue 11365142: Small refactoring in DiskMountManager (event reporting; format method). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: few lint nits Created 8 years, 1 month 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 // chromeos::RemovableDeviceNotificationsCros unit tests. 5 // chromeos::RemovableDeviceNotificationsCros unit tests.
6 6
7 #include "chrome/browser/system_monitor/removable_device_notifications_chromeos. h" 7 #include "chrome/browser/system_monitor/removable_device_notifications_chromeos. h"
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } 81 }
82 82
83 void MountDevice(MountError error_code, 83 void MountDevice(MountError error_code,
84 const DiskMountManager::MountPointInfo& mount_info, 84 const DiskMountManager::MountPointInfo& mount_info,
85 const std::string& unique_id, 85 const std::string& unique_id,
86 const std::string& device_label) { 86 const std::string& device_label) {
87 if (error_code == MOUNT_ERROR_NONE) { 87 if (error_code == MOUNT_ERROR_NONE) {
88 disk_mount_manager_mock_->CreateDiskEntryForMountDevice( 88 disk_mount_manager_mock_->CreateDiskEntryForMountDevice(
89 mount_info, unique_id, device_label); 89 mount_info, unique_id, device_label);
90 } 90 }
91 notifications_->MountCompleted(disks::DiskMountManager::MOUNTING, 91 notifications_->OnMountEvent(disks::DiskMountManager::MOUNTING,
92 error_code, 92 error_code,
93 mount_info); 93 mount_info);
94 WaitForFileThread(); 94 WaitForFileThread();
95 } 95 }
96 96
97 void UnmountDevice(MountError error_code, 97 void UnmountDevice(MountError error_code,
98 const DiskMountManager::MountPointInfo& mount_info) { 98 const DiskMountManager::MountPointInfo& mount_info) {
99 notifications_->MountCompleted(disks::DiskMountManager::UNMOUNTING, 99 notifications_->OnMountEvent(disks::DiskMountManager::UNMOUNTING,
100 error_code, 100 error_code,
101 mount_info); 101 mount_info);
102 if (error_code == MOUNT_ERROR_NONE) { 102 if (error_code == MOUNT_ERROR_NONE) {
103 disk_mount_manager_mock_->RemoveDiskEntryForMountDevice( 103 disk_mount_manager_mock_->RemoveDiskEntryForMountDevice(
104 mount_info); 104 mount_info);
105 } 105 }
106 WaitForFileThread(); 106 WaitForFileThread();
107 } 107 }
108 108
109 // Create a directory named |dir| relative to the test directory. 109 // Create a directory named |dir| relative to the test directory.
110 // Set |with_dcim_dir| to true if the created directory will have a "DCIM" 110 // Set |with_dcim_dir| to true if the created directory will have a "DCIM"
111 // subdirectory. 111 // subdirectory.
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 // Unsupported file system. 240 // Unsupported file system.
241 mount_info.mount_type = MOUNT_TYPE_DEVICE; 241 mount_info.mount_type = MOUNT_TYPE_DEVICE;
242 mount_info.mount_condition = disks::MOUNT_CONDITION_UNSUPPORTED_FILESYSTEM; 242 mount_info.mount_condition = disks::MOUNT_CONDITION_UNSUPPORTED_FILESYSTEM;
243 EXPECT_CALL(observer(), OnRemovableStorageAttached(_, _, _)).Times(0); 243 EXPECT_CALL(observer(), OnRemovableStorageAttached(_, _, _)).Times(0);
244 MountDevice(MOUNT_ERROR_NONE, mount_info, kUniqueId, kDevice1Name); 244 MountDevice(MOUNT_ERROR_NONE, mount_info, kUniqueId, kDevice1Name);
245 } 245 }
246 246
247 } // namespace 247 } // namespace
248 248
249 } // namespace chrome 249 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/system_monitor/removable_device_notifications_chromeos.cc ('k') | chromeos/chromeos.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698