Index: chrome/browser/storage_monitor/storage_monitor_mac_unittest.mm |
diff --git a/chrome/browser/storage_monitor/removable_device_notifications_mac_unittest.mm b/chrome/browser/storage_monitor/storage_monitor_mac_unittest.mm |
similarity index 85% |
rename from chrome/browser/storage_monitor/removable_device_notifications_mac_unittest.mm |
rename to chrome/browser/storage_monitor/storage_monitor_mac_unittest.mm |
index d5fd0388669da4e6fd2105a28a3fda5dfc0e040b..1eab04afcb6c0013b5016f45dc35803940e24fef 100644 |
--- a/chrome/browser/storage_monitor/removable_device_notifications_mac_unittest.mm |
+++ b/chrome/browser/storage_monitor/storage_monitor_mac_unittest.mm |
@@ -2,7 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "chrome/browser/storage_monitor/removable_device_notifications_mac.h" |
+#include "chrome/browser/storage_monitor/storage_monitor_mac.h" |
#include "base/file_util.h" |
#include "base/files/scoped_temp_dir.h" |
@@ -50,15 +50,15 @@ DiskInfoMac CreateDiskInfoMac(const std::string& unique_id, |
} // namespace |
-class RemovableDeviceNotificationsMacTest : public testing::Test { |
+class StorageMonitorMacTest : public testing::Test { |
public: |
- RemovableDeviceNotificationsMacTest() |
+ StorageMonitorMacTest() |
: message_loop_(MessageLoop::TYPE_IO), |
file_thread_(content::BrowserThread::FILE, &message_loop_) { |
} |
virtual void SetUp() OVERRIDE { |
- notifications_ = new RemovableDeviceNotificationsMac; |
+ notifications_ = new StorageMonitorMac; |
mock_storage_observer_.reset(new MockRemovableStorageObserver); |
notifications_->AddObserver(mock_storage_observer_.get()); |
@@ -88,12 +88,12 @@ class RemovableDeviceNotificationsMacTest : public testing::Test { |
std::string device_id_; |
DiskInfoMac disk_info_; |
- scoped_refptr<RemovableDeviceNotificationsMac> notifications_; |
+ scoped_refptr<StorageMonitorMac> notifications_; |
}; |
-TEST_F(RemovableDeviceNotificationsMacTest, AddRemove) { |
+TEST_F(StorageMonitorMacTest, AddRemove) { |
notifications_->UpdateDisk( |
- disk_info_, RemovableDeviceNotificationsMac::UPDATE_DEVICE_ADDED); |
+ disk_info_, StorageMonitorMac::UPDATE_DEVICE_ADDED); |
message_loop_.RunUntilIdle(); |
EXPECT_EQ(1, mock_storage_observer_->attach_calls()); |
EXPECT_EQ(0, mock_storage_observer_->detach_calls()); |
@@ -103,16 +103,16 @@ TEST_F(RemovableDeviceNotificationsMacTest, AddRemove) { |
mock_storage_observer_->last_attached().location); |
notifications_->UpdateDisk( |
- disk_info_, RemovableDeviceNotificationsMac::UPDATE_DEVICE_REMOVED); |
+ disk_info_, StorageMonitorMac::UPDATE_DEVICE_REMOVED); |
message_loop_.RunUntilIdle(); |
EXPECT_EQ(1, mock_storage_observer_->attach_calls()); |
EXPECT_EQ(1, mock_storage_observer_->detach_calls()); |
EXPECT_EQ(device_id_, mock_storage_observer_->last_detached().device_id); |
} |
-TEST_F(RemovableDeviceNotificationsMacTest, UpdateVolumeName) { |
+TEST_F(StorageMonitorMacTest, UpdateVolumeName) { |
notifications_->UpdateDisk( |
- disk_info_, RemovableDeviceNotificationsMac::UPDATE_DEVICE_ADDED); |
+ disk_info_, StorageMonitorMac::UPDATE_DEVICE_ADDED); |
message_loop_.RunUntilIdle(); |
EXPECT_EQ(1, mock_storage_observer_->attach_calls()); |
@@ -127,7 +127,7 @@ TEST_F(RemovableDeviceNotificationsMacTest, UpdateVolumeName) { |
unique_id_, "", ASCIIToUTF16("Test Display Name"), mount_point_, |
kTestSize); |
notifications_->UpdateDisk( |
- info2, RemovableDeviceNotificationsMac::UPDATE_DEVICE_CHANGED); |
+ info2, StorageMonitorMac::UPDATE_DEVICE_CHANGED); |
vandebo (ex-Chrome)
2013/03/01 19:47:39
nit: line wrap.
|
message_loop_.RunUntilIdle(); |
EXPECT_EQ(1, mock_storage_observer_->detach_calls()); |
@@ -139,7 +139,7 @@ TEST_F(RemovableDeviceNotificationsMacTest, UpdateVolumeName) { |
mock_storage_observer_->last_attached().location); |
} |
-TEST_F(RemovableDeviceNotificationsMacTest, DCIM) { |
+TEST_F(StorageMonitorMacTest, DCIM) { |
base::ScopedTempDir temp_dir; |
ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); |
ASSERT_TRUE(file_util::CreateDirectory( |
@@ -153,7 +153,7 @@ TEST_F(RemovableDeviceNotificationsMacTest, DCIM) { |
MediaStorageUtil::REMOVABLE_MASS_STORAGE_WITH_DCIM, unique_id_); |
notifications_->UpdateDisk( |
- info, RemovableDeviceNotificationsMac::UPDATE_DEVICE_ADDED); |
+ info, StorageMonitorMac::UPDATE_DEVICE_ADDED); |
vandebo (ex-Chrome)
2013/03/01 19:47:39
nit: line wrap.
|
message_loop_.RunUntilIdle(); |
EXPECT_EQ(1, mock_storage_observer_->attach_calls()); |
@@ -164,9 +164,9 @@ TEST_F(RemovableDeviceNotificationsMacTest, DCIM) { |
mock_storage_observer_->last_attached().location); |
} |
-TEST_F(RemovableDeviceNotificationsMacTest, GetStorageInfo) { |
+TEST_F(StorageMonitorMacTest, GetStorageInfo) { |
notifications_->UpdateDisk( |
- disk_info_, RemovableDeviceNotificationsMac::UPDATE_DEVICE_ADDED); |
+ disk_info_, StorageMonitorMac::UPDATE_DEVICE_ADDED); |
message_loop_.RunUntilIdle(); |
EXPECT_EQ(1, mock_storage_observer_->attach_calls()); |
@@ -187,9 +187,9 @@ TEST_F(RemovableDeviceNotificationsMacTest, GetStorageInfo) { |
base::FilePath("/non/matching/path"), &info)); |
} |
-TEST_F(RemovableDeviceNotificationsMacTest, GetStorageSize) { |
+TEST_F(StorageMonitorMacTest, GetStorageSize) { |
notifications_->UpdateDisk( |
- disk_info_, RemovableDeviceNotificationsMac::UPDATE_DEVICE_ADDED); |
+ disk_info_, StorageMonitorMac::UPDATE_DEVICE_ADDED); |
message_loop_.RunUntilIdle(); |
EXPECT_EQ(1, mock_storage_observer_->attach_calls()); |
@@ -198,11 +198,11 @@ TEST_F(RemovableDeviceNotificationsMacTest, GetStorageSize) { |
} |
// Test that mounting a DMG doesn't send a notification. |
-TEST_F(RemovableDeviceNotificationsMacTest, DMG) { |
+TEST_F(StorageMonitorMacTest, DMG) { |
DiskInfoMac info = CreateDiskInfoMac( |
unique_id_, "Disk Image", display_name_, mount_point_, kTestSize); |
notifications_->UpdateDisk( |
- info, RemovableDeviceNotificationsMac::UPDATE_DEVICE_ADDED); |
+ info, StorageMonitorMac::UPDATE_DEVICE_ADDED); |
vandebo (ex-Chrome)
2013/03/01 19:47:39
nit: line wrap.
|
message_loop_.RunUntilIdle(); |
EXPECT_EQ(0, mock_storage_observer_->attach_calls()); |
} |