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

Unified Diff: chromeos/dbus/shill_ipconfig_client_unittest.cc

Issue 10949030: This converts the Shill clients to allow propagation of shill errors (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 3 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/dbus/shill_ipconfig_client_unittest.cc
diff --git a/chromeos/dbus/shill_ipconfig_client_unittest.cc b/chromeos/dbus/shill_ipconfig_client_unittest.cc
index 60bca254b9b9af44b3c44be5f07a4abdc77e7819..a89a450694abcf9688b8d0d5c3340868979e351c 100644
--- a/chromeos/dbus/shill_ipconfig_client_unittest.cc
+++ b/chromeos/dbus/shill_ipconfig_client_unittest.cc
@@ -11,6 +11,9 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
+using testing::_;
+using testing::ByRef;
+
namespace chromeos {
namespace {
@@ -54,15 +57,27 @@ TEST_F(ShillIPConfigClientTest, PropertyChanged) {
dbus::AppendBasicTypeValueDataAsVariant(&writer, kConnected);
// Set expectations.
- client_->SetPropertyChangedHandler(dbus::ObjectPath(kExampleIPConfigPath),
- base::Bind(&ExpectPropertyChanged,
- flimflam::kConnectedProperty,
- &kConnected));
+ MockPropertyChangeObserver observer;
+ EXPECT_CALL(observer, OnPropertyChanged(flimflam::kConnectedProperty,
+ ValueEq(ByRef(kConnected)))).Times(1);
+
+ // Add the observer
+ client_->AddPropertyChangedObserver(
+ dbus::ObjectPath(kExampleIPConfigPath),
+ &observer);
+
// Run the signal callback.
SendPropertyChangedSignal(&signal);
- // Reset the handler.
- client_->ResetPropertyChangedHandler(dbus::ObjectPath(kExampleIPConfigPath));
+ // Remove the observer.
+ client_->RemovePropertyChangedObserver(
+ dbus::ObjectPath(kExampleIPConfigPath),
+ &observer);
+
+ EXPECT_CALL(observer, OnPropertyChanged(_, _)).Times(0);
+
+ // Run the signal callback again and make sure the observer isn't called.
+ SendPropertyChangedSignal(&signal);
}
TEST_F(ShillIPConfigClientTest, GetProperties) {

Powered by Google App Engine
This is Rietveld 408576698