shill: rename DispatchOnType to SetProperty
I think this name is clearer. While the function does
have to dispatch based on type, what the caller is trying
to do is to set a property.
BUG=None
TEST=unit tests
Change-Id: I7eedd5a74de7f465310d07271e61cff320645fd8
Reviewed-on: https://gerrit.chromium.org/gerrit/15538
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: mukesh agrawal <quiche@chromium.org>
diff --git a/cellular_unittest.cc b/cellular_unittest.cc
index b62f37a..4ea7524 100644
--- a/cellular_unittest.cc
+++ b/cellular_unittest.cc
@@ -69,10 +69,10 @@
EXPECT_FALSE(device_->store().Contains(""));
}
-TEST_F(CellularPropertyTest, Dispatch) {
+TEST_F(CellularPropertyTest, SetProperty) {
{
::DBus::Error error;
- EXPECT_TRUE(DBusAdaptor::DispatchOnType(
+ EXPECT_TRUE(DBusAdaptor::SetProperty(
device_->mutable_store(),
flimflam::kCellularAllowRoamingProperty,
PropertyStoreTest::kBoolV,
@@ -81,18 +81,18 @@
// Ensure that attempting to write a R/O property returns InvalidArgs error.
{
::DBus::Error error;
- EXPECT_FALSE(DBusAdaptor::DispatchOnType(device_->mutable_store(),
- flimflam::kAddressProperty,
- PropertyStoreTest::kStringV,
- &error));
+ EXPECT_FALSE(DBusAdaptor::SetProperty(device_->mutable_store(),
+ flimflam::kAddressProperty,
+ PropertyStoreTest::kStringV,
+ &error));
EXPECT_EQ(invalid_args(), error.name());
}
{
::DBus::Error error;
- EXPECT_FALSE(DBusAdaptor::DispatchOnType(device_->mutable_store(),
- flimflam::kCarrierProperty,
- PropertyStoreTest::kStringV,
- &error));
+ EXPECT_FALSE(DBusAdaptor::SetProperty(device_->mutable_store(),
+ flimflam::kCarrierProperty,
+ PropertyStoreTest::kStringV,
+ &error));
EXPECT_EQ(invalid_args(), error.name());
}
}
diff --git a/dbus_adaptor.cc b/dbus_adaptor.cc
index 341959f..50cb50d 100644
--- a/dbus_adaptor.cc
+++ b/dbus_adaptor.cc
@@ -40,10 +40,10 @@
DBusAdaptor::~DBusAdaptor() {}
// static
-bool DBusAdaptor::DispatchOnType(PropertyStore *store,
- const string &name,
- const ::DBus::Variant &value,
- ::DBus::Error *error) {
+bool DBusAdaptor::SetProperty(PropertyStore *store,
+ const string &name,
+ const ::DBus::Variant &value,
+ ::DBus::Error *error) {
Error e;
if (DBusAdaptor::IsBool(value.signature()))
diff --git a/dbus_adaptor.h b/dbus_adaptor.h
index f3dc1da..37b83e1 100644
--- a/dbus_adaptor.h
+++ b/dbus_adaptor.h
@@ -31,10 +31,10 @@
DBusAdaptor(DBus::Connection* conn, const std::string &object_path);
virtual ~DBusAdaptor();
- static bool DispatchOnType(PropertyStore *store,
- const std::string &name,
- const ::DBus::Variant &value,
- ::DBus::Error *error);
+ static bool SetProperty(PropertyStore *store,
+ const std::string &name,
+ const ::DBus::Variant &value,
+ ::DBus::Error *error);
static bool GetProperties(const PropertyStore &store,
std::map<std::string, ::DBus::Variant> *out,
::DBus::Error *error);
diff --git a/dbus_adaptor_unittest.cc b/dbus_adaptor_unittest.cc
index f7be163..80dfa5e 100644
--- a/dbus_adaptor_unittest.cc
+++ b/dbus_adaptor_unittest.cc
@@ -163,7 +163,7 @@
EXPECT_FALSE(DBusAdaptor::IsStrings(string_v_.signature()));
}
-TEST_F(DBusAdaptorTest, Dispatch) {
+TEST_F(DBusAdaptorTest, SetProperty) {
MockPropertyStore store;
::DBus::Error e1, e2, e3, e4, e5, e6, e7, e8, e9, e10;
@@ -187,16 +187,16 @@
EXPECT_CALL(store, SetStringProperty("", StrEq(string_path), _))
.WillOnce(Return(true));
- EXPECT_TRUE(DBusAdaptor::DispatchOnType(&store, "", bool_v_, &e1));
- EXPECT_TRUE(DBusAdaptor::DispatchOnType(&store, "", path_v, &e2));
- EXPECT_TRUE(DBusAdaptor::DispatchOnType(&store, "", string_v_, &e3));
- EXPECT_TRUE(DBusAdaptor::DispatchOnType(&store, "", strings_v_, &e4));
- EXPECT_TRUE(DBusAdaptor::DispatchOnType(&store, "", int16_v_, &e5));
- EXPECT_TRUE(DBusAdaptor::DispatchOnType(&store, "", int32_v_, &e6));
- EXPECT_TRUE(DBusAdaptor::DispatchOnType(&store, "", uint16_v_, &e7));
- EXPECT_TRUE(DBusAdaptor::DispatchOnType(&store, "", uint32_v_, &e8));
- EXPECT_TRUE(DBusAdaptor::DispatchOnType(&store, "", stringmap_v_, &e9));
- EXPECT_TRUE(DBusAdaptor::DispatchOnType(&store, "", byte_v_, &e10));
+ EXPECT_TRUE(DBusAdaptor::SetProperty(&store, "", bool_v_, &e1));
+ EXPECT_TRUE(DBusAdaptor::SetProperty(&store, "", path_v, &e2));
+ EXPECT_TRUE(DBusAdaptor::SetProperty(&store, "", string_v_, &e3));
+ EXPECT_TRUE(DBusAdaptor::SetProperty(&store, "", strings_v_, &e4));
+ EXPECT_TRUE(DBusAdaptor::SetProperty(&store, "", int16_v_, &e5));
+ EXPECT_TRUE(DBusAdaptor::SetProperty(&store, "", int32_v_, &e6));
+ EXPECT_TRUE(DBusAdaptor::SetProperty(&store, "", uint16_v_, &e7));
+ EXPECT_TRUE(DBusAdaptor::SetProperty(&store, "", uint32_v_, &e8));
+ EXPECT_TRUE(DBusAdaptor::SetProperty(&store, "", stringmap_v_, &e9));
+ EXPECT_TRUE(DBusAdaptor::SetProperty(&store, "", byte_v_, &e10));
}
void SetError(const string &/*name*/, Error *error) {
diff --git a/device_dbus_adaptor.cc b/device_dbus_adaptor.cc
index 2da87d3..2b1b24e 100644
--- a/device_dbus_adaptor.cc
+++ b/device_dbus_adaptor.cc
@@ -77,7 +77,7 @@
void DeviceDBusAdaptor::SetProperty(const string &name,
const ::DBus::Variant &value,
::DBus::Error &error) {
- DBusAdaptor::DispatchOnType(device_->mutable_store(), name, value, &error);
+ DBusAdaptor::SetProperty(device_->mutable_store(), name, value, &error);
}
void DeviceDBusAdaptor::ClearProperty(const std::string &name,
diff --git a/device_unittest.cc b/device_unittest.cc
index 8378f3f..eb26d3a 100644
--- a/device_unittest.cc
+++ b/device_unittest.cc
@@ -105,18 +105,18 @@
}
}
-TEST_F(DeviceTest, Dispatch) {
+TEST_F(DeviceTest, SetProperty) {
::DBus::Error error;
- EXPECT_TRUE(DBusAdaptor::DispatchOnType(device_->mutable_store(),
- flimflam::kPoweredProperty,
- PropertyStoreTest::kBoolV,
- &error));
+ EXPECT_TRUE(DBusAdaptor::SetProperty(device_->mutable_store(),
+ flimflam::kPoweredProperty,
+ PropertyStoreTest::kBoolV,
+ &error));
// Ensure that an attempt to write a R/O property returns InvalidArgs error.
- EXPECT_FALSE(DBusAdaptor::DispatchOnType(device_->mutable_store(),
- flimflam::kAddressProperty,
- PropertyStoreTest::kStringV,
- &error));
+ EXPECT_FALSE(DBusAdaptor::SetProperty(device_->mutable_store(),
+ flimflam::kAddressProperty,
+ PropertyStoreTest::kStringV,
+ &error));
EXPECT_EQ(invalid_args(), error.name());
}
@@ -124,10 +124,10 @@
::DBus::Error error;
EXPECT_TRUE(device_->powered());
- EXPECT_TRUE(DBusAdaptor::DispatchOnType(device_->mutable_store(),
- flimflam::kPoweredProperty,
- PropertyStoreTest::kBoolV,
- &error));
+ EXPECT_TRUE(DBusAdaptor::SetProperty(device_->mutable_store(),
+ flimflam::kPoweredProperty,
+ PropertyStoreTest::kBoolV,
+ &error));
EXPECT_FALSE(device_->powered());
EXPECT_TRUE(DBusAdaptor::ClearProperty(device_->mutable_store(),
@@ -138,18 +138,18 @@
TEST_F(DeviceTest, ClearReadOnlyProperty) {
::DBus::Error error;
- EXPECT_FALSE(DBusAdaptor::DispatchOnType(device_->mutable_store(),
- flimflam::kAddressProperty,
- PropertyStoreTest::kStringV,
- &error));
+ EXPECT_FALSE(DBusAdaptor::SetProperty(device_->mutable_store(),
+ flimflam::kAddressProperty,
+ PropertyStoreTest::kStringV,
+ &error));
}
TEST_F(DeviceTest, ClearReadOnlyDerivedProperty) {
::DBus::Error error;
- EXPECT_FALSE(DBusAdaptor::DispatchOnType(device_->mutable_store(),
- flimflam::kIPConfigsProperty,
- PropertyStoreTest::kStringsV,
- &error));
+ EXPECT_FALSE(DBusAdaptor::SetProperty(device_->mutable_store(),
+ flimflam::kIPConfigsProperty,
+ PropertyStoreTest::kStringsV,
+ &error));
}
TEST_F(DeviceTest, TechnologyIs) {
diff --git a/dhcp_config_unittest.cc b/dhcp_config_unittest.cc
index 0a19e54..e5817a7 100644
--- a/dhcp_config_unittest.cc
+++ b/dhcp_config_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -374,17 +374,17 @@
EXPECT_CALL(*glib(), SpawnClosePID(kPID)).Times(1); // Invoked by destructor.
}
-TEST_F(DHCPConfigTest, Dispatch) {
- EXPECT_TRUE(DBusAdaptor::DispatchOnType(config_->mutable_store(),
- flimflam::kMtuProperty,
- PropertyStoreTest::kInt32V,
- NULL));
+TEST_F(DHCPConfigTest, SetProperty) {
+ EXPECT_TRUE(DBusAdaptor::SetProperty(config_->mutable_store(),
+ flimflam::kMtuProperty,
+ PropertyStoreTest::kInt32V,
+ NULL));
::DBus::Error error;
// Ensure that an attempt to write a R/O property returns InvalidArgs error.
- EXPECT_FALSE(DBusAdaptor::DispatchOnType(config_->mutable_store(),
- flimflam::kAddressProperty,
- PropertyStoreTest::kStringV,
- &error));
+ EXPECT_FALSE(DBusAdaptor::SetProperty(config_->mutable_store(),
+ flimflam::kAddressProperty,
+ PropertyStoreTest::kStringV,
+ &error));
EXPECT_EQ(invalid_args(), error.name());
}
diff --git a/ipconfig_dbus_adaptor.cc b/ipconfig_dbus_adaptor.cc
index 7a8b60f..8ce6400 100644
--- a/ipconfig_dbus_adaptor.cc
+++ b/ipconfig_dbus_adaptor.cc
@@ -69,10 +69,10 @@
void IPConfigDBusAdaptor::SetProperty(const string &name,
const ::DBus::Variant &value,
::DBus::Error &error) {
- if (DBusAdaptor::DispatchOnType(ipconfig_->mutable_store(),
- name,
- value,
- &error)) {
+ if (DBusAdaptor::SetProperty(ipconfig_->mutable_store(),
+ name,
+ value,
+ &error)) {
PropertyChanged(name, value);
}
}
diff --git a/manager_dbus_adaptor.cc b/manager_dbus_adaptor.cc
index 249b5c7..1745b11 100644
--- a/manager_dbus_adaptor.cc
+++ b/manager_dbus_adaptor.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -88,10 +88,10 @@
void ManagerDBusAdaptor::SetProperty(const string &name,
const ::DBus::Variant &value,
::DBus::Error &error) {
- if (DBusAdaptor::DispatchOnType(manager_->mutable_store(),
- name,
- value,
- &error)) {
+ if (DBusAdaptor::SetProperty(manager_->mutable_store(),
+ name,
+ value,
+ &error)) {
PropertyChanged(name, value);
}
}
diff --git a/manager_unittest.cc b/manager_unittest.cc
index 143b9f2..65fa465 100644
--- a/manager_unittest.cc
+++ b/manager_unittest.cc
@@ -772,42 +772,42 @@
EXPECT_EQ(profile1, s_configure_succeed->profile());
}
-TEST_F(ManagerTest, Dispatch) {
+TEST_F(ManagerTest, SetProperty) {
{
::DBus::Error error;
- EXPECT_TRUE(DBusAdaptor::DispatchOnType(manager()->mutable_store(),
- flimflam::kOfflineModeProperty,
- PropertyStoreTest::kBoolV,
- &error));
+ EXPECT_TRUE(DBusAdaptor::SetProperty(manager()->mutable_store(),
+ flimflam::kOfflineModeProperty,
+ PropertyStoreTest::kBoolV,
+ &error));
}
{
::DBus::Error error;
- EXPECT_TRUE(DBusAdaptor::DispatchOnType(manager()->mutable_store(),
- flimflam::kCountryProperty,
- PropertyStoreTest::kStringV,
- &error));
+ EXPECT_TRUE(DBusAdaptor::SetProperty(manager()->mutable_store(),
+ flimflam::kCountryProperty,
+ PropertyStoreTest::kStringV,
+ &error));
}
// Attempt to write with value of wrong type should return InvalidArgs.
{
::DBus::Error error;
- EXPECT_FALSE(DBusAdaptor::DispatchOnType(manager()->mutable_store(),
- flimflam::kCountryProperty,
- PropertyStoreTest::kBoolV,
- &error));
+ EXPECT_FALSE(DBusAdaptor::SetProperty(manager()->mutable_store(),
+ flimflam::kCountryProperty,
+ PropertyStoreTest::kBoolV,
+ &error));
EXPECT_EQ(invalid_args(), error.name());
}
{
::DBus::Error error;
- EXPECT_FALSE(DBusAdaptor::DispatchOnType(manager()->mutable_store(),
- flimflam::kOfflineModeProperty,
- PropertyStoreTest::kStringV,
- &error));
+ EXPECT_FALSE(DBusAdaptor::SetProperty(manager()->mutable_store(),
+ flimflam::kOfflineModeProperty,
+ PropertyStoreTest::kStringV,
+ &error));
EXPECT_EQ(invalid_args(), error.name());
}
// Attempt to write R/O property should return InvalidArgs.
{
::DBus::Error error;
- EXPECT_FALSE(DBusAdaptor::DispatchOnType(
+ EXPECT_FALSE(DBusAdaptor::SetProperty(
manager()->mutable_store(),
flimflam::kEnabledTechnologiesProperty,
PropertyStoreTest::kStringsV,
diff --git a/profile_dbus_adaptor.cc b/profile_dbus_adaptor.cc
index 6ebf8bd..2224d0a 100644
--- a/profile_dbus_adaptor.cc
+++ b/profile_dbus_adaptor.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -64,10 +64,10 @@
void ProfileDBusAdaptor::SetProperty(const string &name,
const ::DBus::Variant &value,
::DBus::Error &error) {
- if (DBusAdaptor::DispatchOnType(profile_->mutable_store(),
- name,
- value,
- &error)) {
+ if (DBusAdaptor::SetProperty(profile_->mutable_store(),
+ name,
+ value,
+ &error)) {
PropertyChanged(name, value);
}
}
diff --git a/property_store_unittest.cc b/property_store_unittest.cc
index ec1ee9b..33a77f6 100644
--- a/property_store_unittest.cc
+++ b/property_store_unittest.cc
@@ -86,7 +86,7 @@
// Ensure that an attempt to write unknown properties returns InvalidProperty.
PropertyStore store;
::DBus::Error error;
- EXPECT_FALSE(DBusAdaptor::DispatchOnType(&store, "", GetParam(), &error));
+ EXPECT_FALSE(DBusAdaptor::SetProperty(&store, "", GetParam(), &error));
EXPECT_EQ(invalid_prop(), error.name());
}
@@ -214,7 +214,7 @@
TEST_F(PropertyStoreTest, SetStringmapsProperty) {
PropertyStore store;
::DBus::Error error;
- EXPECT_FALSE(DBusAdaptor::DispatchOnType(
+ EXPECT_FALSE(DBusAdaptor::SetProperty(
&store, "", PropertyStoreTest::kStringmapsV, &error));
EXPECT_EQ(internal_error(), error.name());
}
diff --git a/service.h b/service.h
index f00e99b..b1d4cbf 100644
--- a/service.h
+++ b/service.h
@@ -342,7 +342,6 @@
FRIEND_TEST(DeviceTest, SelectedService);
FRIEND_TEST(ManagerTest, SortServicesWithConnection);
FRIEND_TEST(ServiceTest, Constructor);
- FRIEND_TEST(ServiceTest, Dispatch);
FRIEND_TEST(ServiceTest, GetProperties);
FRIEND_TEST(ServiceTest, IsAutoConnectable);
FRIEND_TEST(ServiceTest, Save);
@@ -350,6 +349,7 @@
FRIEND_TEST(ServiceTest, SaveStringCrypted);
FRIEND_TEST(ServiceTest, SaveStringDontSave);
FRIEND_TEST(ServiceTest, SaveStringEmpty);
+ FRIEND_TEST(ServiceTest, SetProperty);
FRIEND_TEST(ServiceTest, Unload);
bool GetAutoConnect(Error *error);
diff --git a/service_dbus_adaptor.cc b/service_dbus_adaptor.cc
index 6a54471..ccdb85e 100644
--- a/service_dbus_adaptor.cc
+++ b/service_dbus_adaptor.cc
@@ -68,7 +68,7 @@
void ServiceDBusAdaptor::SetProperty(const string &name,
const ::DBus::Variant &value,
::DBus::Error &error) {
- DBusAdaptor::DispatchOnType(service_->mutable_store(), name, value, &error);
+ DBusAdaptor::SetProperty(service_->mutable_store(), name, value, &error);
}
void ServiceDBusAdaptor::ClearProperty(const string &name,
diff --git a/service_unittest.cc b/service_unittest.cc
index 24cd06c..bb43eaa 100644
--- a/service_unittest.cc
+++ b/service_unittest.cc
@@ -115,52 +115,52 @@
}
}
-TEST_F(ServiceTest, Dispatch) {
+TEST_F(ServiceTest, SetProperty) {
{
::DBus::Error error;
- EXPECT_TRUE(DBusAdaptor::DispatchOnType(service_->mutable_store(),
- flimflam::kSaveCredentialsProperty,
- PropertyStoreTest::kBoolV,
- &error));
+ EXPECT_TRUE(DBusAdaptor::SetProperty(service_->mutable_store(),
+ flimflam::kSaveCredentialsProperty,
+ PropertyStoreTest::kBoolV,
+ &error));
}
{
::DBus::Error error;
- EXPECT_TRUE(DBusAdaptor::DispatchOnType(service_->mutable_store(),
- flimflam::kPriorityProperty,
- PropertyStoreTest::kInt32V,
- &error));
+ EXPECT_TRUE(DBusAdaptor::SetProperty(service_->mutable_store(),
+ flimflam::kPriorityProperty,
+ PropertyStoreTest::kInt32V,
+ &error));
}
{
::DBus::Error error;
- EXPECT_TRUE(DBusAdaptor::DispatchOnType(service_->mutable_store(),
- flimflam::kEAPEAPProperty,
- PropertyStoreTest::kStringV,
- &error));
+ EXPECT_TRUE(DBusAdaptor::SetProperty(service_->mutable_store(),
+ flimflam::kEAPEAPProperty,
+ PropertyStoreTest::kStringV,
+ &error));
}
// Ensure that an attempt to write a R/O property returns InvalidArgs error.
{
::DBus::Error error;
- EXPECT_FALSE(DBusAdaptor::DispatchOnType(service_->mutable_store(),
- flimflam::kFavoriteProperty,
- PropertyStoreTest::kBoolV,
- &error));
+ EXPECT_FALSE(DBusAdaptor::SetProperty(service_->mutable_store(),
+ flimflam::kFavoriteProperty,
+ PropertyStoreTest::kBoolV,
+ &error));
EXPECT_EQ(invalid_args(), error.name());
}
{
::DBus::Error error;
service_->set_favorite(true);
- EXPECT_TRUE(DBusAdaptor::DispatchOnType(service_->mutable_store(),
- flimflam::kAutoConnectProperty,
- PropertyStoreTest::kBoolV,
- &error));
+ EXPECT_TRUE(DBusAdaptor::SetProperty(service_->mutable_store(),
+ flimflam::kAutoConnectProperty,
+ PropertyStoreTest::kBoolV,
+ &error));
}
{
::DBus::Error error;
service_->set_favorite(false);
- EXPECT_FALSE(DBusAdaptor::DispatchOnType(service_->mutable_store(),
- flimflam::kAutoConnectProperty,
- PropertyStoreTest::kBoolV,
- &error));
+ EXPECT_FALSE(DBusAdaptor::SetProperty(service_->mutable_store(),
+ flimflam::kAutoConnectProperty,
+ PropertyStoreTest::kBoolV,
+ &error));
EXPECT_EQ(invalid_args(), error.name());
}
}
diff --git a/wifi_service_unittest.cc b/wifi_service_unittest.cc
index 5794f07..5d1f433 100644
--- a/wifi_service_unittest.cc
+++ b/wifi_service_unittest.cc
@@ -771,7 +771,7 @@
EXPECT_EQ("", wifi_service->passphrase_);
::DBus::Error error;
- EXPECT_TRUE(DBusAdaptor::DispatchOnType(
+ EXPECT_TRUE(DBusAdaptor::SetProperty(
wifi_service->mutable_store(),
flimflam::kPassphraseProperty,
DBusAdaptor::StringToVariant("0:abcde"),
diff --git a/wifi_unittest.cc b/wifi_unittest.cc
index aee2e18..084e0f1 100644
--- a/wifi_unittest.cc
+++ b/wifi_unittest.cc
@@ -86,10 +86,10 @@
EXPECT_FALSE(device_->store().Contains(""));
}
-TEST_F(WiFiPropertyTest, Dispatch) {
+TEST_F(WiFiPropertyTest, SetProperty) {
{
::DBus::Error error;
- EXPECT_TRUE(DBusAdaptor::DispatchOnType(
+ EXPECT_TRUE(DBusAdaptor::SetProperty(
device_->mutable_store(),
flimflam::kBgscanSignalThresholdProperty,
PropertyStoreTest::kInt32V,
@@ -97,26 +97,24 @@
}
{
::DBus::Error error;
- EXPECT_TRUE(DBusAdaptor::DispatchOnType(device_->mutable_store(),
- flimflam::kScanIntervalProperty,
- PropertyStoreTest::kUint16V,
- &error));
+ EXPECT_TRUE(DBusAdaptor::SetProperty(device_->mutable_store(),
+ flimflam::kScanIntervalProperty,
+ PropertyStoreTest::kUint16V,
+ &error));
}
// Ensure that an attempt to write a R/O property returns InvalidArgs error.
{
::DBus::Error error;
- EXPECT_FALSE(DBusAdaptor::DispatchOnType(device_->mutable_store(),
- flimflam::kScanningProperty,
- PropertyStoreTest::kBoolV,
- &error));
+ EXPECT_FALSE(DBusAdaptor::SetProperty(device_->mutable_store(),
+ flimflam::kScanningProperty,
+ PropertyStoreTest::kBoolV,
+ &error));
EXPECT_EQ(invalid_args(), error.name());
}
-}
-TEST_F(WiFiPropertyTest, BgscanMethod) {
{
::DBus::Error error;
- EXPECT_TRUE(DBusAdaptor::DispatchOnType(
+ EXPECT_TRUE(DBusAdaptor::SetProperty(
device_->mutable_store(),
flimflam::kBgscanMethodProperty,
DBusAdaptor::StringToVariant(
@@ -126,7 +124,7 @@
{
::DBus::Error error;
- EXPECT_FALSE(DBusAdaptor::DispatchOnType(
+ EXPECT_FALSE(DBusAdaptor::SetProperty(
device_->mutable_store(),
flimflam::kBgscanMethodProperty,
DBusAdaptor::StringToVariant("not a real scan method"),
@@ -140,7 +138,7 @@
EXPECT_EQ(WiFi::kDefaultBgscanMethod, device_->bgscan_method_);
::DBus::Error error;
- EXPECT_TRUE(DBusAdaptor::DispatchOnType(
+ EXPECT_TRUE(DBusAdaptor::SetProperty(
device_->mutable_store(),
flimflam::kBgscanMethodProperty,
DBusAdaptor::StringToVariant(