Age | Commit message (Collapse) | Author |
|
am: f07ce4ed69
* commit 'f07ce4ed69c3c2624f4aae422d1ed62a8ac7a44c':
dbus-binding-generator: Update libchrome APIs to r369476
|
|
The new libchrome has been ported from Chromium and some APIs have
changed. Make necessary changes at call sites.
Change-Id: I792e854c58fadce96e153e081fc8fc6e129da6dc
|
|
am: 4d7450f263
* commit '4d7450f26396d6a5d3135e058873d484c3857aa0':
Fix compiler warnings in dbus-binding-generator
|
|
Do this for both in repository code and generated code.
Bug: 26379019
Test: compiles, unittests pass
Change-Id: Ic1e387d914696639c0ad495d3ecb6f0a60bcb981
|
|
am: 9f6fb89c67
* commit '9f6fb89c67950128c98e723fad5263369f103faf':
Match SetPropertyChangedCallback signature in mocked object.
|
|
BUG: 26092352
Change-Id: Iba1e8cac5707daaf7b09c38af60b46852662c151
|
|
am: e4ba481e55
* commit 'e4ba481e55e2b0e1cb1fa528005bcfc3da361424':
Drop the "-host" suffix on libchrome and libbrillo.
|
|
am: daea81b234
* commit 'daea81b234ad10d0ecd0410521e517fa89f7b2e0':
Move SetPropertyChangedCallback to proxy interface and add a mock
|
|
To be aligned with the new build system, the host and target modules
should have the same name. This patch updates the libchrome and
libbrillo dependencies.
Bug: 24619596
TEST=mma on linux and mac
Change-Id: I09abfcefc7e0758adb10889433b90354d81e4838
(cherry picked from commit 2eab379c2966e0d9aad3e1dd6b3a4df50e2504c3)
|
|
|
|
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
|
|
To be aligned with the new build system, the host and target modules
should have the same name. This patch updates the libchrome and
libbrillo dependencies.
Bug: 24619596
TEST=mma on linux and mac
Change-Id: I09abfcefc7e0758adb10889433b90354d81e4838
|
|
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
|
|
Use abstract proxy interfaces instead of concrete proxy instances.
This allows client to mock out APIs and facilitate testing.
Had to add the ability to obtain an object path from the interface
as well as set properties on interfaces, as these were used by the
current callers.
BUG: 26092352
Change-Id: I853d37f60fbe6d56e33171c82cd74520e38711cf
|
|
Remaining changes missed in the original CL.
BUG: 24872993
Change-Id: Id4ad17d4cc454ff79307a919357cbaf00968ef93
|
|
BUG: 24872993
Change-Id: I02898f06e056ea769fe2509e699f8582975d9ff5
|
|
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
|
|
With a portable subset of libchromeos-host now available, it's now
possible to build this tool for non-Linux hosts.
BUG=24073089
TEST=build on Mac host, also build tool using it
Change-Id: Ic9a169f84ec68eaa3c43817cb2e4572be90ad228
|
|
destructor"
This reverts commit a31c5257ce2673c8cdcb8e43e2a1dd40e926009d.
The original CL breaks some system services (such as crash_reporter)
in Chrome OS. Instead, fix the original issue by explicitly calling
XXXProxy::ReleaseObjectProxy.
BUG=23560086
Change-Id: I90c7c1cecc5132bd3d78be77cbe79ad45f41a99d
|
|
This will free up resources that the bus allocated for the given proxy,
avoid any memory/resource leak.
BUG=23560086
TEST=unittest
TEST=Verify generated proxy code
Change-Id: I0e6b7387ee01cbd4564174f0a8817aa784fd6295
|
|
chromeos-dbus-bindings was moved to a subdirectory. In order for the
import path to import headers with chromeos-dbus-bindings/*, we need to
add the parent directory to the include directories.
BUG=chromium:515556
TEST=`emerge-gizmo chromeos-dbus-bindings` works.
Change-Id: I97f38fcdb4f94f57cbdf896a76c97f13f031a2a6
|
|
(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>
|
|
(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>
|
|
This includes support to build both the host build tool and the
host unittests.
Bug: 22608897
Change-Id: Iee07b18be658462fb0549d4c12cae8aae26e8d2d
|
|
|
|
This reverts commit 885fbff615a8a740131bf740812c6ca72ee3c01d.
Change-Id: I00b1ae8d77732beb816077b94bf289dae67b31ed
|
|
|
|
We're going to set up the chromeos-dbus-bindings ebuild to
build this source in chromeos with a directory structure like:
platform2/dbus-binding-generator/chromeos-dbus-bindings/
rather than the previous
platform2/chromeos-dbus-bindings/
This requires we modify where we look for common-mk a little.
Change-Id: I87b8d9c3455dcd6227328376d16125a636575d0e
|
|
This includes support to build both the host build tool and the
host unittests.
Bug: 22608897
Change-Id: I23a24f702b7366ce8bbf3e39e9d22345cd57655a
|
|
|
|
In order to pass around ownership of *Proxy objects using
*ProxyInterface classes we need to be able to destroy them from the
abstract interface. This patch moves the destructor to the public side.
To fix blank lines, this patch moves the blank lines added on all
methods to a line *before* the block instead of a line after the
block.
BUG=chromium:419827
TEST=Updated unittest. Generated code still compiles.
Change-Id: If7c7c2e0dfcb7887f523558726fc65a62221d89e
Reviewed-on: https://chromium-review.googlesource.com/289318
Trybot-Ready: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
|
|
*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>
|
|
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>
|
|
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>
|
|
Change-Id: I6588bad92f8f114a1e66f3e73b240ac43e75ed2b
|
|
|
|
BUG=None
TEST=Compiles here and on Android
Change-Id: Ifae7bb9cfc886b7d52a4aeb73e3cd0981fb3df6d
Reviewed-on: https://chromium-review.googlesource.com/287301
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Christopher Wiley <wiley@chromium.org>
|
|
As required per style and to support using -Wnon-virtual-dtor on generated
code, this patch makes the protected destructor virtual on the proxy
interface.
BUG=None
TEST=sudo env FEATURES=test emerge chromeos-dbus-bindings; update_engine_client compiles with -Wnon-virtual-dtor.
Change-Id: I9904cf823e5e3fc028ab870adbbbd26a3f0da44b
Reviewed-on: https://chromium-review.googlesource.com/280877
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
|
|
libchrome r334380 has the following breaking changes that need to be fixed:
- base::JSONWriter::Write() and base::JSONWriter::WriteWithOptions() take
"const base::Value&" instead of "const base::Value*"
- base::JSONReader::Read() and base::JSONReader::ReadAndReturnError()
return a scoped_ptr<base::Value> instead of base::Value*
- base/safe_strerror_posix.h is moved to base/posix/safe_strerror.h
- safe_strerror() is now in "base" namespace
- StartsWithASCII(), EndsWith(), StringToUpperASCII(), LowerCaseEqualsASCII()
are now in "base" namespace
- ObserverList<T> is now in "base" namespace
- base::PrintTo(base::FilePath) used in gtest is now moved to libchrome-test
library and as such, unit test runners need to link to this library now.
- crypto::RSAPrivateKey::CreateSensitive() is now removed from //crypto, so
some of tests in chromeos-login that used that function had to be changed
to use crypto::GenerateRSAKeyPairNSS() directly.
- UnixDomanSocket class is now in "base" namespace
- Pickle class is now in "base" namespace
BUG=chromium:496469
TEST=`./build_packages`
CQ-DEPEND=CL:277662
Change-Id: I36e5fbf2e36a92068873ffbd44020c862a3ed9e3
Reviewed-on: https://chromium-review.googlesource.com/277671
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
Trybot-Ready: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
|
|
Changed callbacks to use std::unique_ptr in D-Bus method handlers instead of
scoped_ptr, now that we can do this with base::Callback.
This eliminates the need to mix scoped_ptr and std::unique_ptr in the same
translation unit.
Sweep the code in the rest of platform2 that used libchromeos's D-Bus framework.
BUG=None
TEST=`FEATURES=test emerge-link libchromeos apmanager attestation buffet chromeos-dbus-bindings`
Change-Id: I50289198ef9ab183d5bc7d0c8cc7a8f53085e5a4
Reviewed-on: https://chromium-review.googlesource.com/267337
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Trybot-Ready: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
|
|
The current revision of libchrome is removing CommandLine class
from global namespace and only retain the one in base::.
Sweep the code to use the correct namespace in anticpation of
libchrome revision roll.
BUG=None
TEST=./build_packages
Change-Id: Ib7ca448dac1204c1e36ab053e775a5a5214997ac
Reviewed-on: https://chromium-review.googlesource.com/263785
Trybot-Ready: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
|
|
With newer glibc versions (2.18+), these macros no longer exist (and the
functionality they protected are always enabled). Delete them.
BUG=chromium:401360
TEST=precq passes
Change-Id: I21b0607a874b9f9e39dff050054a2928a6c55023
Reviewed-on: https://chromium-review.googlesource.com/262903
Trybot-Ready: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
|
|
We need to store the passed in service name and pass it to proxies
we create when not configured with a service name in the dbus config.
BUG=brillo:581
TEST=leaderd changes which depend on this compile, unittests.
Change-Id: Id53f3a0c45ac64d477ba1d723952679cc3eb1b29
Reviewed-on: https://chromium-review.googlesource.com/260014
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Christopher Wiley <wiley@chromium.org>
|
|
std::string version of functions is enough to cover char use cases.
C library was replaced with STL in Split and SplitAtFirst implementations.
Added support of splitting by empty string. Uses but reasonable implementation
is simple.
BUG=none
TEST=unittests
Change-Id: I0778722d31a7b06eea2227b4d94991ab194195cb
Reviewed-on: https://chromium-review.googlesource.com/258640
Reviewed-by: Vitaly Buka <vitalybuka@chromium.org>
Commit-Queue: Vitaly Buka <vitalybuka@chromium.org>
Tested-by: Vitaly Buka <vitalybuka@chromium.org>
|
|
Properties such as 'UUID' were convered to 'u_u_i_d' while trying
to convert 'CamelCase' identifier to 'google_style' variable name.
Do not break up consecutive uppercase characters into separate
'words'.
BUG=brillo:387
TEST=FEATURES=test emerge-link chromeos-dbus-bindings
Change-Id: I541f12e33d1c36d9ae2cf9fdba5ca9e23096fc46
Reviewed-on: https://chromium-review.googlesource.com/254180
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
|
|
For D-Bus objects with single fixed object path assume that they are
singletons and remove the object path parameter from the proxy
accessor ObjectManagerProxy::GetNNNProxy() method.
BUG=brillo:348
TEST=`FEATURES=test emerge-link chromeos-dbus-bindings`
`FEATURES=test emerge-link peerd privetd buffet apmanager lorgnette`
Change-Id: I29419e2db5bd0fc8a4f508804c1e322c1880a3dd
Reviewed-on: https://chromium-review.googlesource.com/252422
Trybot-Ready: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
|
|
D-Bus property names tend to be used in client code literally to
validate the property name in property change notifications, etc.
This forces clients to hard-code the name in their code and when
an interface definition changes in XML and new adaptor/proxies are
generated, the client code is not updated but still compiles, so the
breaking change is hard to notice.
Expose property name accessors in the generated code which makes the
client break at compile time if the property name is changed.
BUG=brillo:348
TEST=`FEATURES=test emerge-link chromeos-dbus-bindings`
Change-Id: I21bb2c06faf134aa92c923085ddeebce16806fb8
Reviewed-on: https://chromium-review.googlesource.com/252420
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
|
|
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>
|
|
Added a new annotation attribute ("org.chromium.DBus.Method.IncludeDBusMessage")
for "normal" and "async" methods to allow to pass the raw D-Bus message
to the handler, so it can extract additional useful information (like
the message sender, etc).
BUG=brillo:346
TEST=`FEATURES=test emerge-link chromeos-dbus-bindings`
Change-Id: Iec2ff6154cfdbc8a36a84014688011e23762ba3a
Reviewed-on: https://chromium-review.googlesource.com/252321
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
|
|
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>
|