History log of /external/dbus-binding-generator/chromeos-dbus-bindings/proxy_generator_mock_unittest.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
9f6fb89c67950128c98e723fad5263369f103faf 14-Dec-2015 Dan Colish <colish@google.com> Match SetPropertyChangedCallback signature in mocked object.

BUG: 26092352
Change-Id: Iba1e8cac5707daaf7b09c38af60b46852662c151
/external/dbus-binding-generator/chromeos-dbus-bindings/proxy_generator_mock_unittest.cc
daea81b234ad10d0ecd0410521e517fa89f7b2e0 10-Dec-2015 Alex Vakulenko <avakulenko@google.com> Move SetPropertyChangedCallback to proxy interface and add a mock

Moved the declaration of SetPropertyChangedCallback() to D-Bus proxy
interface so this method can be used with an interface as well as
mocked out properly.

BUG: 26092352
Change-Id: Id6077eaacaac13672e5ce02614fd7574b2397150
/external/dbus-binding-generator/chromeos-dbus-bindings/proxy_generator_mock_unittest.cc
d0eca9d166717a07605c7080f9d859a2f09bd4ef 09-Dec-2015 Alex Vakulenko <avakulenko@google.com> dbus-binding-generator: Fix mock generation and support for readwrite props

Previous change added "set_<name>()" for writable properties, but that
was done unconditionally, even for read-only properties. Added check for
property access qualifier.

Mock generation was missing for GetObjectPath and property setters.

BUG: 26092352
Change-Id: Ib30267f41c7a937ea8543f02bbe17719ef15cca9
/external/dbus-binding-generator/chromeos-dbus-bindings/proxy_generator_mock_unittest.cc
be6240db3b8a0981ce0f800247105154ff8e4960 13-Oct-2015 Alex Vakulenko <avakulenko@google.com> Rename "chromeos" -> "brillo" in include paths and namespaces

libchromeos is transitioning to libbrillo and chromeos namespaces
and include directory is changing to brillo.

BUG: 24872993
TEST=built on aosp and dragonboard, unit tests passed
the generated proxies/adaptors in other projects compile correctly

Change-Id: Idd11c5eebc1e5b80825321dd25f06a8af6f1cd26
/external/dbus-binding-generator/chromeos-dbus-bindings/proxy_generator_mock_unittest.cc
a30e09dde8bde67a44a2275b58d3f9d058207e57 04-Aug-2015 Christopher Wiley <wiley@google.com> chromeos-dbus-bindings: Literal proxy includes for mocks

(cherry-pick of platform2 5b6ba1c6b8140d3d4e069d9afcdabdfb3a5669ce)

Change the DBus binding generator to accept a flag
--proxy-path-in-mocks which takes the literal path to include the proxy
header at. This works around some behavior where the generator
would attempt to infer this path by constructing a relative path from
the mock path to the proxy file path. This breaks when we install
the mock headers to the build root, rather than using them from where
they were generated.

BUG=chromium:516514
TEST=unittests, trybots

Change-Id: I96c7429cc4344bd9a3764efb09b2f014dd2420ac
Reviewed-on: https://chromium-review.googlesource.com/290448
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Christopher Wiley <wiley@chromium.org>
Commit-Queue: Christopher Wiley <wiley@chromium.org>
/external/dbus-binding-generator/chromeos-dbus-bindings/proxy_generator_mock_unittest.cc
464405e052175cd0421742a917d0a69cab46a89d 30-Jul-2015 Alex Deymo <deymo@chromium.org> chromeos-dbus-bindings: Handle mocks all the way up to eleven.

(cherry-pick of platform2 240e46d3b77a969611ec6855cbb2e95a4293a3b6)

gmock doesn't define MOCK_METHODn for n greater than 10 due to some
legacy compiler limitations in older Visual Studio versions. While
hanving methods with more than 10 arguments is rare and a bad idea in
general, we have some DBus methods that will generate wrappers with
more than 10 arguments, between DBus method arguments and the added
callbacks, and timeouts.

This patch avoids the problem by not generating an invalid MOCK_METHOD
entry for such methods and leaving the chance for the user of such
mock to subclass it and implement such method in a different way or
ignore the problem if the method in the mock was not needed at all. To
do this we provide a default implementation with a warning.

BUG=chromium:419827
TEST=Added unittests. Generated flimflam.ManagerProxy mocks that now compile.

Change-Id: I742217b1cdd8bfb4ee5a37bec51485e21cb654d9
Reviewed-on: https://chromium-review.googlesource.com/289835
Commit-Queue: Alex Deymo <deymo@chromium.org>
Trybot-Ready: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
/external/dbus-binding-generator/chromeos-dbus-bindings/proxy_generator_mock_unittest.cc
ce286b950d6b6db208459931a1604720903303cc 29-Jul-2015 Alex Deymo <deymo@chromium.org> chromeos-dbus-bindings: Expose Register*Handler() methods in the *ProxyInterface.

The generated proxy is split in two: an abstract interface
(class *ProxyInterface) and the actual implementation that sends the
dbus calls (class *Proxy). For signals, we can register a signal
handler using the Register*Handler() method in the Proxy class, but it
is not available in the ProxyInterface.

This patch defines the Register*Handler() methods in the abstract
interface and includes the corresponding method in the ProxyMock class
so the unittests can check that the signals are handled and the code
under test can receive a ProxyInterface instance and register the
handler with it.

BUG=None
TEST=Unittests updated.

Change-Id: Ife2f91591e87e8c8c3edda76db32c6327b145a81
Reviewed-on: https://chromium-review.googlesource.com/289330
Commit-Queue: Alex Deymo <deymo@chromium.org>
Trybot-Ready: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
/external/dbus-binding-generator/chromeos-dbus-bindings/proxy_generator_mock_unittest.cc
f211ae662aee9b2d4cb8538e9845b5389ba0cc3e 28-Jul-2015 Alex Deymo <deymo@chromium.org> chromeos-dbus-bindings: Print output diff when failing a test.

To help test-driven-development techniques and prevent lazy developers
from copy-pasting the output of the test into the expected results
without inspecting them, this patch shows the unified diff between
the expected result and the generated file.

It is still possible to update the unittest code by appliying the
patch to the *_unittest.cc file.

BUG=None
TEST=Modified an expected result and saw the diff on the unittest.

Change-Id: If24479fed1fa3be67f2a99c092206bf27cf2b110
Reviewed-on: https://chromium-review.googlesource.com/289300
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Trybot-Ready: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
/external/dbus-binding-generator/chromeos-dbus-bindings/proxy_generator_mock_unittest.cc
d0cb3fe72b7070d373bf960550b7cbfb0adbe843 28-Jul-2015 Christopher Wiley <wiley@google.com> chromeos-dbus-bindings: Fix more sign issues

BUG=None
TEST=Compiles on Android without sign comparison warnings.

Change-Id: I818975146bd028e50ae20948211b959e022fb0bb
Reviewed-on: https://chromium-review.googlesource.com/288926
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Christopher Wiley <wiley@chromium.org>
/external/dbus-binding-generator/chromeos-dbus-bindings/proxy_generator_mock_unittest.cc
b69be601eba1d4a1d5fdd8121a93c8fb67217fc8 23-Feb-2015 Alex Vakulenko <avakulenko@chromium.org> chromeos-dbus-bindings: Inline some of named constants in tests

In order to make tests more readable and maintainable, removed named
constants and use string literals in their place. Since pretty much all
of these constants were used only once in a test, there is no benefit
in creating a constant, but it makes it difficult to read the test and
add new conditions/expectations.

BUG=None
TEST=`FEATURES=test emerge-link chromeos-dbus-bindings`

Change-Id: I220f528f98301b7ff9f08106f9c32b3d5e87309c
Reviewed-on: https://chromium-review.googlesource.com/252353
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
/external/dbus-binding-generator/chromeos-dbus-bindings/proxy_generator_mock_unittest.cc
008e19dd69bfc8439454a14df159b5a829881956 21-Jan-2015 Alex Vakulenko <avakulenko@chromium.org> chromeos-dbus-bindings: Added proxy mock generation

Now it is possible to generate Mocks for D-Bus proxy objects to
mock out the D-Bus interfaces in tests.

A new option --mock=<file> is added to the generator to specify
the output file for the mock objects. If used with --proxy,
the mock header file will include the proxy header file to share
the definition of the common interface proxy abstract interface.
Otherwise, the mock header file will provide its own definition
of that abstract interface.

As a result, the proxy generation has been changed to include
the base abstract interface for the D-Bus interface proxy class
which the proxy and/or mock objects derive from.

The code using the proxy objects can be updated to pass around
the abstract interface instead of concrete proxy classes which
will make it possible to substruture proxies with mocks and
facilitate testing of the code using D-Bus proxies.

GYP action now has another variable 'mock_output_file' which
can be used along with 'proxy_output_file' to control the
location of the generated mock header file:

'actions': [
{
'action_name': 'generate-buffet-proxies',
'variables': {
'dbus_service_config': 'dbus_bindings/dbus-service-config.json',
'proxy_output_file': 'include/buffet/dbus-proxies.h'
'mock_output_file': 'include/buffet/dbus-mocks.h'
},
'sources': [
'dbus_bindings/org.chromium.Buffet.Command.xml',
'dbus_bindings/org.chromium.Buffet.Manager.xml',
],
'includes': ['../common-mk/generate-dbus-proxies.gypi'],
},
],

BUG=chromium:449176
TEST=FEATURES=test emerge-link chromeos-dbus-bindings
Manually tested the generated proxy and mock classes with
buffet.

Change-Id: I1fb84cfbfd751793df72ad5b050ee1cf00a64d62
Reviewed-on: https://chromium-review.googlesource.com/242276
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
/external/dbus-binding-generator/chromeos-dbus-bindings/proxy_generator_mock_unittest.cc