History log of /system/connectivity/shill/property_accessor_unittest.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
1ee315fe16a7e91f43f1b24f5f2c0a47b52e3455 06-Jan-2016 Victor Dodon <printesoi@google.com> shill: Add ByteArray properties

Bug: None
BUG=chromium:574578
TEST=New unit tests

Change-Id: Ifddfa995d1a8ab8f9d9e82b4a897ce51c92f092b
/system/connectivity/shill/property_accessor_unittest.cc
c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5 03-Sep-2015 Peter Qiu <zqiu@google.com> License shill to Apache2

This patch automatically replaced the license on all text files from
Chromium OS (BSD style) to AOSP (Apache2), keeping the original year as
a reference.

The license header was added to .gyp and .gypi, the NOTICE was added with a copy
of the Apache2 license and MODULE_LICENSE_* file was added.

BUG=23587594
TEST=grep 'Chromium OS Authors' doesn't find anything.

Change-Id: If41ede586c2465f5831fb7fee270ff41dbfdb596
/system/connectivity/shill/property_accessor_unittest.cc
3b30ca58d13cf66b75ba0729b222ddc42ae68b33 16-Jun-2015 Paul Stewart <pstew@chromium.org> shill: Top-level unit tests: Switch pointer/ref spacing

Switch to Chrome style spacing.

BUG=chromium:501026
TEST=Unit tests

Change-Id: I86c072b89281e0de18928b47860b99d779af061a
Reviewed-on: https://chromium-review.googlesource.com/278037
Reviewed-by: Rebecca Silberstein <silberst@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/property_accessor_unittest.cc
cc225ef3b77b5e098cc12c661a947e1737480777 30-Sep-2014 Ben Chan <benchan@chromium.org> shill: Replace NULL with nullptr.

BUG=None
TEST=`USE=wimax FEATURES=test emerge-$BOARD shill`

Change-Id: I30ab47ff32dcadad09ae7a2baf4d4123a6ef0d8e
Reviewed-on: https://chromium-review.googlesource.com/220657
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/property_accessor_unittest.cc
cc67c52a2c00f90e877971d552208dd99825d84e 03-Sep-2014 Ben Chan <benchan@chromium.org> shill: Include base/macros.h instead of base/basictypes.h

shill no longer uses the integer types from base/basictypes.h. It should
simply include base/macros.h for the DISALLOW_COPY_AND_ASSIGN macro
instead.

BUG=None
TEST=`USE='cellular wimax' FEATURES=test emerge-$BOARD platform2`

Change-Id: I9b350c1bd9eff88e2c87de2ef8d607e90049e102
Reviewed-on: https://chromium-review.googlesource.com/216055
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/property_accessor_unittest.cc
7fab89734d88724a288e96a9996b15548c5294c7 11-Aug-2014 Ben Chan <benchan@chromium.org> shill: Use integer types from stdint.h

This CL replaces the deprecated int* and uint* types from
'base/basictypes.h' with the int*_t and uint*_t types from 'stdint.h'.

BUG=chromium:401356
TEST=`USE='cellular gdmwimax wimax' FEATURES=test emerge-$BOARD platform2`

Change-Id: I3d4c195881203dd2a47dbb5af150b6c90b9c206e
Reviewed-on: https://chromium-review.googlesource.com/211770
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/property_accessor_unittest.cc
8a5322984f2d81bcbfd8d44c59747a11bd9b904b 17-Jun-2014 Alex Vakulenko <avakulenko@chromium.org> shill: Fix most of warnings from cpplint

Fix most cpplinter's warnings. On a few occasisions, the warnings
produced were false-positives, so added explicit // NOLINT comment
overrides.

There were a few instances of disallowed non-const reference usage
(reported as runtime/reference error by cpplint) for
"DBus::Error &error" which should potentially be changed
to pointers to comply with C++ coding style but I will let Shill
owners do that since there is quite a few of those and the
change isn't brain-dead simple...

BUG=None
TEST=platform2 still compiles and all unit tests pass.

Change-Id: Ic2e31896aa13d20eeb1a85dee74f3db8cccfde2e
Reviewed-on: https://chromium-review.googlesource.com/204164
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
/system/connectivity/shill/property_accessor_unittest.cc
1cf7eb8dcb037d45b23ed85b777c227b7ab39069 04-Dec-2013 Paul Stewart <pstew@chromium.org> shill: PropertyAccessor: Create a const ReadOnly accessor

Provide a means to create an Accessor child class which can be
constructed with a const method. This is useful for read-only
properties which won't modify the called object's state. Make
use of this new feature by transforming the HelpRegisterConst*
in the Service object to take const methods and to register
read only accessors. The bulk of this CL is the change to all
the subclasses to constify methods which were only non-const
due to this issue.

BUG=chromium:325603
TEST=Unit test

Change-Id: I79c6211e9e0907869c2885937dff58c1faf2ca4a
Reviewed-on: https://chromium-review.googlesource.com/178698
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/property_accessor_unittest.cc
985d7d5d3c1ef2f00941b89f2b79963f23808489 16-Oct-2013 Paul Stewart <pstew@chromium.org> shill: CustomAccessor: Allow custom Clear methods

Allow creators of a CustomAccessor to provide a clear method
instead of using the default of calling Set() with the default
value. This allows providing a clear method without providing
a set method (not so useful) as well as allowing a property
owner to perform ancillary actions specific to returning a
property to its default state.

BUG=chromium:307692
TEST=Unit test

Change-Id: I02413782e2cccfd6679c3d2945aa218236c82115
Reviewed-on: https://chromium-review.googlesource.com/173321
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
/system/connectivity/shill/property_accessor_unittest.cc
bebf1b8bce52b88c2cc2d93200b9405f9c19cf21 24-Apr-2013 mukesh agrawal <quiche@chromium.org> shill: make setting a property to its current value a no-op

Before this change, setting the EAP authentication properties
on a WiFiService would cause the connection to be dropped.
The connection would drop even if the new values were the same
as the old.

With this change, the connection is only dropped if the new
values differ from the old.

Overview of changes:
- AccessorInterface: have property setters return a bool (rather
than void). Setters should return true to indicate the value was
changed, and false otherwise.
- PropertyAccessor and derived classes:
- Implement the new AccessorInterface.
- Add tests that we implement the new AccessorInterface.
- Custom property setters (various classes):
- Update existing custom setters to return true if the value was
changed, and false otherwise.
- Add tests that custom setters implement the desired behavior.
- DBusAdaptor
- Change SetProperty to propagate the return value of
PropertyStore's setters, rather than Error::IsSuccess().
- In combination with other changes, this means
DBusAdaptor::SetProperty now returns false if the new value is
the same as the old.
- This also suppresses some spurious change notifications from
IPConfig, Manager, and Profile objects.
- Add tests that DBusAdaptor::SetProperty implements the desired
behavior.
- PropertyStore
- Add a change callback. This optional argument to the ctor is
invoked if a setter or clearer modified its property. This
is so that classes don't have to depend on their RPC adaptors
to inform them of a change. (See changes in Service.)
- Have setters pass through the return value of the Accessor,
rather than returning Error::IsSuccess(). In
combination with other changes, this means that setters
now returns false if the new value is the same as the old.
- Add tests that PropertyStore invokes the change callback
appropriately.
- ClearPropertyNonexistent, SetPropertyNonexistent: no callback
- ClearProperty: callback
- SetProperty: callback if and only if property changed
- Service
- Register OnPropertyChanged with PropertyStore, instead of relying
on a callback from ServiceDBusAdaptor. Two reasons for the change:
1) The RPC adaptors should be as trivial as possible, and
2) We can't test code in the RPC adaptors.
3) If we can't test code in the RPC adaptors, go to 1.
- ServiceDBusAdaptor: remove OnPropertyChange callback in SetProperty.
See Service for the rationale.
- Update existing SetProperty tests (various classes)
We now use values that differ from the current value of the property.
This ensures that the setter returns true.
- WiFiServiceTest: add a case to test that EAP authentication property
changes caused cached credentials to be cleared appropriately. This is
redundant given some of the other tests. But given that this was the
original problem in the bug, it seems worth testing specifically.
- HACKING: add some guidelines for what to do when adding properties.

While there:
- Change some HelpRegister... functions to HelpRegisterConst...
- Update some tests to check error.is_set() before reading
error.name(). This avoids a stray pointer dereference.
- Add SetStringmapsProperty to PropertyStore. This is needed because
PropertyStoreTypedTest now tests setters.
- Remove duplicate kAutoConnectProperty test case in ServiceTest.SetProperty
- Remove unused local in WiFiServiceTest.SetPassphraseRemovedCachedCredentials
- Remove unused method Device::HelpRegisterDerivedStrings
- Remove KeyValueStore from the set of types exercised by
PropertyStoreTypedTest. We only use KeyValueStore for const
properties, and PropertyStoreTypedTest tests setting and
clearing.
- Add PropertyChanges test to EthernetEapServiceTest.
BUG=chromium:233681
TEST=new unit tests

Change-Id: I9bdd89fbe6f19101dfcd5f126f2ba9c81533ff97
Reviewed-on: https://gerrit.chromium.org/gerrit/49733
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/property_accessor_unittest.cc
ebd3856da9d213154f3c85a71e4ec8e8fce3b9ea 23-Mar-2012 Paul Stewart <pstew@chromium.org> shill: vpn: Use Mapped custom accessor for properties

VPN services simply ask their drivers to populate their PropertyStore.
VPN drivers use CustomMapped accessors to make their KeyValueStore
available.

BUG=chromium-os:28303,chromium-os:28223
TEST=New unit tests

Change-Id: I05a4f2c09ddd03b40b947274fd38572da5d6dbdc
Reviewed-on: https://gerrit.chromium.org/gerrit/18989
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/property_accessor_unittest.cc
a61593e58a41fb2d6c25e0b1c2405f5246f22699 23-Mar-2012 Paul Stewart <pstew@chromium.org> shill: Create a Mapped custom property accessor

Create an accessor that passes a property key to the get/set/clear.

BUG=chromium-os:28303
TEST=New unit tests

Change-Id: If9cb94cf60427c49c5e87c828b787fc6d17d1a0c
Reviewed-on: https://gerrit.chromium.org/gerrit/18988
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/property_accessor_unittest.cc
6b883fed9013bc74a294cc05cf804aaefae4915d 31-Jan-2012 mukesh agrawal <quiche@chromium.org> shill: fix bug in property accessor unit tests

We should register the variable we're modifying, not the value
that we're going to set the variable to.

BUG=None
TEST=unit tests

Change-Id: I83e26596b510bf650f54b480d657cd23fce664d6
Reviewed-on: https://gerrit.chromium.org/gerrit/15540
Reviewed-by: Thieu Le <thieule@chromium.org>
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/property_accessor_unittest.cc
292dc0f18ce6ba7ea1419efc4d8ef909712bb7c2 27-Jan-2012 mukesh agrawal <quiche@chromium.org> shill: teach property accessors how to clear properties,
and update code that instantiates property accessors
accordingly.

BUG=chromium-os:24814
TEST=new unit tests

Change-Id: Iae385c331648e74916c2eb2b69c41ccc9cdcafdf
Reviewed-on: https://gerrit.chromium.org/gerrit/15289
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/property_accessor_unittest.cc
1b7a616197af7ff753dbe7614a8e207b1e10ac1a 09-Nov-2011 Gaurav Shah <gauravsh@chromium.org> shill: Implement write-only properties

Certain properties (e.g. WIFI Passphrase) are write only and must
not be returned when Service.GetProperties() is called over D-Bus.

This CL implements WriteOnlyProperties, a write-only analog of the
read-only ConstProperties.

Also add a ReadablePropertyConstIterator which only returns the
readable properties. Switch over DBus adaptor and PropertyStore
to use that.

BUG=chromium-os:21196
TEST=Added 2 new unittests.

Change-Id: I52815cc395650e0b49e1acac8d4954deeebcee5d
Reviewed-on: https://gerrit.chromium.org/gerrit/11402
Commit-Ready: Gaurav Shah <gauravsh@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Gaurav Shah <gauravsh@chromium.org>
/system/connectivity/shill/property_accessor_unittest.cc
ffa3d0433d419aa9251f3768a0090a27b6b1c434 07-Oct-2011 mukesh agrawal <quiche@chromium.org> shill: allow property accessors to return an error message if a
property's value cannot be changed.

also, reduce some code duplication in property_store.cc

BUG=chromium-os:21384
TEST=unittests

Change-Id: Iaac8d40bbb9e9a1341d6c6d01642885d88ac0e27
Reviewed-on: http://gerrit.chromium.org/gerrit/8925
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/property_accessor_unittest.cc
27bf1036f4468bd4cd235fe385b7eb460f49c9fa 29-Jun-2011 Chris Masone <cmasone@chromium.org> [shill] add unit tests for PropertyAccessor stuff

BUG=None
TEST=unit tests

Change-Id: I28b5fbe503209456f12ee5f77071bc2a291d4dc3
Reviewed-on: http://gerrit.chromium.org/gerrit/3343
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/property_accessor_unittest.cc