shill: Emit more property change notifications for Services.
Add property change notifications for all the Service properties that
Chrome currently pays attention to. Also add unit tests for these
property change notifications.
While there:
- add some more tips to TESTING
- update service-api documentation for AutoConnect
(it is settable for non-favorite services, and has been for
some time)
- update some ServiceTests to no longer set_favorite before
changing AutoConnect (set_favorite is no longer necessary,
as noted above)
- clarify service-api documentation for Device property
- make the security_ field of WiFiService const (it is only
set in the ctor, and designating it const makes it obvious
why there's no property change for it)
- fix bug where VPNService would change the Favorite property,
but not signal the change
BUG=chromium:230329
TEST=new unit tests
Change-Id: Ia387b1ab90fa80fd218cd69e0fd8126ff4c5a2ae
Reviewed-on: https://gerrit.chromium.org/gerrit/48459
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
diff --git a/service_property_change_test.h b/service_property_change_test.h
new file mode 100644
index 0000000..ecf8433
--- /dev/null
+++ b/service_property_change_test.h
@@ -0,0 +1,29 @@
+// Copyright (c) 2013 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.
+
+#ifndef SHILL_TEST_COMMON_H_
+#define SHILL_TEST_COMMON_H_
+
+#include "shill/refptr_types.h"
+
+namespace shill {
+
+class ServiceMockAdaptor;
+
+// Test property change notifications that are implemented by all
+// Services.
+void TestCommonPropertyChanges(ServiceRefPtr service,
+ ServiceMockAdaptor *adaptor);
+// Test AutoConnect property change notification. Implemented by
+// all Services except EthernetService.
+void TestAutoConnectPropertyChange(ServiceRefPtr service,
+ ServiceMockAdaptor *adaptor);
+// Test Name property change notification. Only VPNService allows
+// changing the name property.
+void TestNamePropertyChange(ServiceRefPtr service,
+ ServiceMockAdaptor *adaptor);
+
+} // namespace shill
+
+#endif // SHILL_TEST_COMMON_H_