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

Unified Diff: chromeos/network/shill_property_handler_unittest.cc

Issue 14813021: Observe property updates for all Network Services (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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
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 34e685a103fdac8380b0d202a7554dcfe82e3cbd..c41bbdbff3e45b8c977a9258423093946513761f 100644
--- a/chromeos/network/shill_property_handler_unittest.cc
+++ b/chromeos/network/shill_property_handler_unittest.cc
@@ -324,10 +324,13 @@ TEST_F(ShillPropertyHandlerTest, ShillPropertyHandlerServicePropertyChanged) {
flimflam::kStateIdle, false);
message_loop_.RunUntilIdle();
EXPECT_EQ(1, listener_->manager_updates()); // No new manager updates.
- // Only watched services trigger a service list update.
- EXPECT_EQ(1, listener_->list_updates(flimflam::kServicesProperty));
+ // Watched and unwatched services trigger a service list update.
+ EXPECT_EQ(2, listener_->list_updates(flimflam::kServicesProperty));
EXPECT_EQ(kNumShillManagerClientStubImplServices + 1,
listener_->entries(flimflam::kServicesProperty).size());
+ // Service receives an initial property update.
+ EXPECT_EQ(1, listener_->
+ property_updates(flimflam::kServicesProperty)[kTestServicePath]);
// Change a property.
base::FundamentalValue scan_interval(3);
DBusThreadManager::Get()->GetShillServiceClient()->SetProperty(
@@ -336,8 +339,8 @@ TEST_F(ShillPropertyHandlerTest, ShillPropertyHandlerServicePropertyChanged) {
scan_interval,
base::Bind(&base::DoNothing), base::Bind(&ErrorCallbackFunction));
message_loop_.RunUntilIdle();
- // Property change should NOT trigger an update.
- EXPECT_EQ(0, listener_->
+ // Property change triggers an update.
+ EXPECT_EQ(2, listener_->
property_updates(flimflam::kServicesProperty)[kTestServicePath]);
// Add the existing service to the watch list.
@@ -349,9 +352,6 @@ TEST_F(ShillPropertyHandlerTest, ShillPropertyHandlerServicePropertyChanged) {
// Number of services shouldn't change.
EXPECT_EQ(kNumShillManagerClientStubImplServices + 1,
listener_->entries(flimflam::kServicesProperty).size());
- // Property update should be received when watched service is added.
- EXPECT_EQ(1, listener_->
- property_updates(flimflam::kServicesProperty)[kTestServicePath]);
// Change a property.
DBusThreadManager::Get()->GetShillServiceClient()->SetProperty(
@@ -361,7 +361,7 @@ TEST_F(ShillPropertyHandlerTest, ShillPropertyHandlerServicePropertyChanged) {
base::Bind(&base::DoNothing), base::Bind(&ErrorCallbackFunction));
message_loop_.RunUntilIdle();
// Property change should trigger another update.
- EXPECT_EQ(2, listener_->
+ EXPECT_EQ(3, listener_->
property_updates(flimflam::kServicesProperty)[kTestServicePath]);
// Remove a service
« chromeos/network/shill_property_handler.cc ('K') | « chromeos/network/shill_property_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698