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

Side by Side Diff: chrome/browser/storage_monitor/storage_monitor_unittest.cc

Issue 12382005: Rename RemovableDeviceNotifications=>StorageMonitor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 9 months 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
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 "base/message_loop.h" 5 #include "base/message_loop.h"
6 #include "base/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
7 #include "chrome/browser/storage_monitor/mock_removable_storage_observer.h" 7 #include "chrome/browser/storage_monitor/mock_removable_storage_observer.h"
8 #include "chrome/browser/storage_monitor/storage_monitor.h" 8 #include "chrome/browser/storage_monitor/storage_monitor.h"
9 #include "chrome/browser/storage_monitor/test_storage_monitor.h" 9 #include "chrome/browser/storage_monitor/test_storage_monitor.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 } 58 }
59 59
60 TEST(StorageMonitorTest, GetAttachedStorageEmpty) { 60 TEST(StorageMonitorTest, GetAttachedStorageEmpty) {
61 MessageLoop message_loop; 61 MessageLoop message_loop;
62 test::TestStorageMonitor monitor; 62 test::TestStorageMonitor monitor;
63 std::vector<StorageMonitor::StorageInfo> devices = 63 std::vector<StorageMonitor::StorageInfo> devices =
64 monitor.GetAttachedStorage(); 64 monitor.GetAttachedStorage();
65 EXPECT_EQ(0U, devices.size()); 65 EXPECT_EQ(0U, devices.size());
66 } 66 }
67 67
68 TEST(StorageMonitorTest, 68 TEST(StorageMonitorTest, GetRemovableStorageAttachDetach) {
69 GetRemovableStorageAttachDetach) {
70 MessageLoop message_loop; 69 MessageLoop message_loop;
71 test::TestStorageMonitor monitor; 70 test::TestStorageMonitor monitor;
72 const std::string kDeviceId1 = "42"; 71 const std::string kDeviceId1 = "42";
73 const string16 kDeviceName1 = ASCIIToUTF16("test"); 72 const string16 kDeviceName1 = ASCIIToUTF16("test");
74 const base::FilePath kDevicePath1(FILE_PATH_LITERAL("/testfoo")); 73 const base::FilePath kDevicePath1(FILE_PATH_LITERAL("/testfoo"));
75 monitor.receiver()->ProcessAttach(StorageMonitor::StorageInfo( 74 monitor.receiver()->ProcessAttach(StorageMonitor::StorageInfo(
76 kDeviceId1, kDeviceName1, kDevicePath1.value())); 75 kDeviceId1, kDeviceName1, kDevicePath1.value()));
77 message_loop.RunUntilIdle(); 76 message_loop.RunUntilIdle();
78 std::vector<StorageMonitor::StorageInfo> devices = 77 std::vector<StorageMonitor::StorageInfo> devices =
79 monitor.GetAttachedStorage(); 78 monitor.GetAttachedStorage();
(...skipping 25 matching lines...) Expand all
105 EXPECT_EQ(kDeviceName2, devices[0].name); 104 EXPECT_EQ(kDeviceName2, devices[0].name);
106 EXPECT_EQ(kDevicePath2.value(), devices[0].location); 105 EXPECT_EQ(kDevicePath2.value(), devices[0].location);
107 106
108 monitor.receiver()->ProcessDetach(kDeviceId2); 107 monitor.receiver()->ProcessDetach(kDeviceId2);
109 message_loop.RunUntilIdle(); 108 message_loop.RunUntilIdle();
110 devices = monitor.GetAttachedStorage(); 109 devices = monitor.GetAttachedStorage();
111 EXPECT_EQ(0U, devices.size()); 110 EXPECT_EQ(0U, devices.size());
112 } 111 }
113 112
114 } // namespace chrome 113 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/storage_monitor/storage_monitor_mac_unittest.mm ('k') | chrome/browser/storage_monitor/storage_monitor_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698