diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-23 23:02:14 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-23 23:02:14 +0000 |
commit | 1df9dda059dca5fa86bbb28d36b7c088612af2ab (patch) | |
tree | e575dc110a2869d045347c5def9ef4b2e61379fd /base/system_monitor/system_monitor_unittest.cc | |
parent | bb149f89c5d24d3cdc420e7de2635a72a403c3a5 (diff) | |
download | chromium_src-1df9dda059dca5fa86bbb28d36b7c088612af2ab.zip chromium_src-1df9dda059dca5fa86bbb28d36b7c088612af2ab.tar.gz chromium_src-1df9dda059dca5fa86bbb28d36b7c088612af2ab.tar.bz2 |
Change SystemMonitor::GetAttachedMediaDevices() to return a vector instead of a vector*.
BUG=none
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10388244
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138645 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/system_monitor/system_monitor_unittest.cc')
-rw-r--r-- | base/system_monitor/system_monitor_unittest.cc | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/base/system_monitor/system_monitor_unittest.cc b/base/system_monitor/system_monitor_unittest.cc index 7e7810a..26055e6 100644 --- a/base/system_monitor/system_monitor_unittest.cc +++ b/base/system_monitor/system_monitor_unittest.cc @@ -143,9 +143,9 @@ TEST_F(SystemMonitorTest, DeviceChangeNotifications) { } TEST_F(SystemMonitorTest, GetAttachedMediaDevicesEmpty) { - scoped_ptr<std::vector<SystemMonitor::MediaDeviceInfo> > devices; - devices.reset(system_monitor_->GetAttachedMediaDevices()); - EXPECT_EQ(0U, devices->size()); + std::vector<SystemMonitor::MediaDeviceInfo> devices = + system_monitor_->GetAttachedMediaDevices(); + EXPECT_EQ(0U, devices.size()); } TEST_F(SystemMonitorTest, GetAttachedMediaDevicesAttachDetach) { @@ -156,12 +156,12 @@ TEST_F(SystemMonitorTest, GetAttachedMediaDevicesAttachDetach) { kDeviceName1, kDevicePath1); message_loop_.RunAllPending(); - scoped_ptr<std::vector<SystemMonitor::MediaDeviceInfo> > devices; - devices.reset(system_monitor_->GetAttachedMediaDevices()); - ASSERT_EQ(1U, devices->size()); - EXPECT_EQ(kDeviceId1, (*devices)[0].a); - EXPECT_EQ(kDeviceName1, (*devices)[0].b); - EXPECT_EQ(kDevicePath1, (*devices)[0].c); + std::vector<SystemMonitor::MediaDeviceInfo> devices = + system_monitor_->GetAttachedMediaDevices(); + ASSERT_EQ(1U, devices.size()); + EXPECT_EQ(kDeviceId1, devices[0].a); + EXPECT_EQ(kDeviceName1, devices[0].b); + EXPECT_EQ(kDevicePath1, devices[0].c); const SystemMonitor::DeviceIdType kDeviceId2 = 44; const char kDeviceName2[] = "test2"; @@ -170,27 +170,27 @@ TEST_F(SystemMonitorTest, GetAttachedMediaDevicesAttachDetach) { kDeviceName2, kDevicePath2); message_loop_.RunAllPending(); - devices.reset(system_monitor_->GetAttachedMediaDevices()); - ASSERT_EQ(2U, devices->size()); - EXPECT_EQ(kDeviceId1, (*devices)[0].a); - EXPECT_EQ(kDeviceName1, (*devices)[0].b); - EXPECT_EQ(kDevicePath1, (*devices)[0].c); - EXPECT_EQ(kDeviceId2, (*devices)[1].a); - EXPECT_EQ(kDeviceName2, (*devices)[1].b); - EXPECT_EQ(kDevicePath2, (*devices)[1].c); + devices = system_monitor_->GetAttachedMediaDevices(); + ASSERT_EQ(2U, devices.size()); + EXPECT_EQ(kDeviceId1, devices[0].a); + EXPECT_EQ(kDeviceName1, devices[0].b); + EXPECT_EQ(kDevicePath1, devices[0].c); + EXPECT_EQ(kDeviceId2, devices[1].a); + EXPECT_EQ(kDeviceName2, devices[1].b); + EXPECT_EQ(kDevicePath2, devices[1].c); system_monitor_->ProcessMediaDeviceDetached(kDeviceId1); message_loop_.RunAllPending(); - devices.reset(system_monitor_->GetAttachedMediaDevices()); - ASSERT_EQ(1U, devices->size()); - EXPECT_EQ(kDeviceId2, (*devices)[0].a); - EXPECT_EQ(kDeviceName2, (*devices)[0].b); - EXPECT_EQ(kDevicePath2, (*devices)[0].c); + devices = system_monitor_->GetAttachedMediaDevices(); + ASSERT_EQ(1U, devices.size()); + EXPECT_EQ(kDeviceId2, devices[0].a); + EXPECT_EQ(kDeviceName2, devices[0].b); + EXPECT_EQ(kDevicePath2, devices[0].c); system_monitor_->ProcessMediaDeviceDetached(kDeviceId2); message_loop_.RunAllPending(); - devices.reset(system_monitor_->GetAttachedMediaDevices()); - EXPECT_EQ(0U, devices->size()); + devices = system_monitor_->GetAttachedMediaDevices(); + EXPECT_EQ(0U, devices.size()); } TEST_F(SystemMonitorTest, PowerRequirements) { |