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

Unified Diff: chromeos/network/shill_property_handler_unittest.cc

Issue 330833003: Rely on Service.Visible instead of Manager.Services (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix stubs for tests Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/network/shill_property_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/shill_property_handler_unittest.cc
diff --git a/chromeos/network/shill_property_handler_unittest.cc b/chromeos/network/shill_property_handler_unittest.cc
index 7ac23322c3a039e21aff29e03d886298d9979868..341b9cad595530356fbe4dbcfa677395a5c4be9f 100644
--- a/chromeos/network/shill_property_handler_unittest.cc
+++ b/chromeos/network/shill_property_handler_unittest.cc
@@ -47,11 +47,6 @@ class TestListener : public internal::ShillPropertyHandler::Listener {
UpdateEntries(GetTypeString(type), entries);
}
- virtual void UpdateVisibleNetworks(const base::ListValue& entries) OVERRIDE {
- VLOG(1) << "UpdateVisibleNetworks: " << entries.GetSize();
- UpdateEntries(shill::kServicesProperty, entries);
- }
-
virtual void UpdateManagedStateProperties(
ManagedState::ManagedType type,
const std::string& path,
@@ -305,7 +300,7 @@ TEST_F(ShillPropertyHandlerTest, ShillPropertyHandlerStub) {
listener_->entries(shill::kDevicesProperty).size());
const size_t kNumShillManagerClientStubImplServices = 4;
EXPECT_EQ(kNumShillManagerClientStubImplServices,
- listener_->entries(shill::kServicesProperty).size());
+ listener_->entries(shill::kServiceCompleteListProperty).size());
EXPECT_EQ(0, listener_->errors());
}
@@ -368,7 +363,7 @@ TEST_F(ShillPropertyHandlerTest, ShillPropertyHandlerDevicePropertyChanged) {
TEST_F(ShillPropertyHandlerTest, ShillPropertyHandlerServicePropertyChanged) {
const size_t kNumShillManagerClientStubImplServices = 4;
EXPECT_EQ(kNumShillManagerClientStubImplServices,
- listener_->entries(shill::kServicesProperty).size());
+ listener_->entries(shill::kServiceCompleteListProperty).size());
// Add a service.
listener_->reset_list_updates();
@@ -378,7 +373,7 @@ TEST_F(ShillPropertyHandlerTest, ShillPropertyHandlerServicePropertyChanged) {
// Add should trigger a service list update and update entries.
EXPECT_EQ(1, listener_->list_updates(shill::kServiceCompleteListProperty));
EXPECT_EQ(kNumShillManagerClientStubImplServices + 1,
- listener_->entries(shill::kServicesProperty).size());
+ listener_->entries(shill::kServiceCompleteListProperty).size());
// Service receives an initial property update.
EXPECT_EQ(1, listener_->initial_property_updates(
shill::kServiceCompleteListProperty)[kTestServicePath]);
@@ -394,8 +389,8 @@ TEST_F(ShillPropertyHandlerTest, ShillPropertyHandlerServicePropertyChanged) {
EXPECT_EQ(1, listener_->property_updates(
shill::kServiceCompleteListProperty)[kTestServicePath]);
- // Change the visibility of a service. This will signal two service list
- // updates, one for the complete list and one for the visible list.
+ // Change the visibility of a service. This will trigger a service list
+ // updates.
listener_->reset_list_updates();
DBusThreadManager::Get()->GetShillServiceClient()->SetProperty(
dbus::ObjectPath(kTestServicePath),
@@ -403,7 +398,7 @@ TEST_F(ShillPropertyHandlerTest, ShillPropertyHandlerServicePropertyChanged) {
base::FundamentalValue(false),
base::Bind(&base::DoNothing), base::Bind(&ErrorCallbackFunction));
message_loop_.RunUntilIdle();
- EXPECT_EQ(2, listener_->list_updates(shill::kServiceCompleteListProperty));
+ EXPECT_EQ(1, listener_->list_updates(shill::kServiceCompleteListProperty));
// Remove a service. This will update the entries and signal a service list
// update.
@@ -412,7 +407,7 @@ TEST_F(ShillPropertyHandlerTest, ShillPropertyHandlerServicePropertyChanged) {
message_loop_.RunUntilIdle();
EXPECT_EQ(1, listener_->list_updates(shill::kServiceCompleteListProperty));
EXPECT_EQ(kNumShillManagerClientStubImplServices,
- listener_->entries(shill::kServicesProperty).size());
+ listener_->entries(shill::kServiceCompleteListProperty).size());
EXPECT_EQ(0, listener_->errors());
}
@@ -480,16 +475,15 @@ TEST_F(ShillPropertyHandlerTest, ShillPropertyHandlerServiceList) {
AddServiceToProfile(shill::kTypeWifi, kTestServicePath1, false /* visible */);
message_loop_.RunUntilIdle();
- // Update the Manager properties. This should trigger a single list update
- // and a single initial property update.
+ // Update the Manager properties. This should trigger a single list update,
+ // an initial property update, and a regular property update.
listener_->reset_list_updates();
shill_property_handler_->UpdateManagerProperties();
message_loop_.RunUntilIdle();
EXPECT_EQ(1, listener_->list_updates(shill::kServiceCompleteListProperty));
EXPECT_EQ(1, listener_->initial_property_updates(
shill::kServiceCompleteListProperty)[kTestServicePath1]);
-
- EXPECT_EQ(0, listener_->property_updates(
+ EXPECT_EQ(1, listener_->property_updates(
shill::kServiceCompleteListProperty)[kTestServicePath1]);
// Add a new entry to the services and the profile; should also trigger a
« no previous file with comments | « chromeos/network/shill_property_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698