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

Side by Side Diff: chrome/browser/storage_monitor/storage_monitor_mac_unittest.mm

Issue 100573002: Move directory creation functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 "chrome/browser/storage_monitor/storage_monitor_mac.h" 5 #include "chrome/browser/storage_monitor/storage_monitor_mac.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/mac/foundation_util.h" 9 #include "base/mac/foundation_util.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 EXPECT_EQ(string16(), mock_storage_observer_->last_attached().name()); 121 EXPECT_EQ(string16(), mock_storage_observer_->last_attached().name());
122 EXPECT_EQ(kTestSize * 2, 122 EXPECT_EQ(kTestSize * 2,
123 mock_storage_observer_->last_attached().total_size_in_bytes()); 123 mock_storage_observer_->last_attached().total_size_in_bytes());
124 EXPECT_EQ(mount_point_.value(), 124 EXPECT_EQ(mount_point_.value(),
125 mock_storage_observer_->last_attached().location()); 125 mock_storage_observer_->last_attached().location());
126 } 126 }
127 127
128 TEST_F(StorageMonitorMacTest, DCIM) { 128 TEST_F(StorageMonitorMacTest, DCIM) {
129 base::ScopedTempDir temp_dir; 129 base::ScopedTempDir temp_dir;
130 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); 130 ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
131 ASSERT_TRUE(file_util::CreateDirectory( 131 ASSERT_TRUE(base::CreateDirectory(
132 temp_dir.path().Append(kDCIMDirectoryName))); 132 temp_dir.path().Append(kDCIMDirectoryName)));
133 133
134 base::FilePath mount_point = temp_dir.path(); 134 base::FilePath mount_point = temp_dir.path();
135 std::string device_id = StorageInfo::MakeDeviceId( 135 std::string device_id = StorageInfo::MakeDeviceId(
136 StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM, unique_id_); 136 StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM, unique_id_);
137 StorageInfo info = CreateStorageInfo(device_id, "", mount_point, kTestSize); 137 StorageInfo info = CreateStorageInfo(device_id, "", mount_point, kTestSize);
138 138
139 UpdateDisk(info, StorageMonitorMac::UPDATE_DEVICE_ADDED); 139 UpdateDisk(info, StorageMonitorMac::UPDATE_DEVICE_ADDED);
140 140
141 EXPECT_EQ(1, mock_storage_observer_->attach_calls()); 141 EXPECT_EQ(1, mock_storage_observer_->attach_calls());
(...skipping 26 matching lines...) Expand all
168 base::FilePath("/non/matching/path"), &info)); 168 base::FilePath("/non/matching/path"), &info));
169 } 169 }
170 170
171 // Test that mounting a DMG doesn't send a notification. 171 // Test that mounting a DMG doesn't send a notification.
172 TEST_F(StorageMonitorMacTest, DMG) { 172 TEST_F(StorageMonitorMacTest, DMG) {
173 StorageInfo info = CreateStorageInfo( 173 StorageInfo info = CreateStorageInfo(
174 device_id_, "Disk Image", mount_point_, kTestSize); 174 device_id_, "Disk Image", mount_point_, kTestSize);
175 UpdateDisk(info, StorageMonitorMac::UPDATE_DEVICE_ADDED); 175 UpdateDisk(info, StorageMonitorMac::UPDATE_DEVICE_ADDED);
176 EXPECT_EQ(0, mock_storage_observer_->attach_calls()); 176 EXPECT_EQ(0, mock_storage_observer_->attach_calls());
177 } 177 }
OLDNEW
« no previous file with comments | « chrome/browser/storage_monitor/storage_monitor_linux_unittest.cc ('k') | chrome/browser/sync/glue/sync_backend_host_core.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698