summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-01-21dbus-binding-generator: Update libchrome APIs to r369476android-cts_7.1_r1android-cts-7.1_r9android-cts-7.1_r8android-cts-7.1_r7android-cts-7.1_r6android-cts-7.1_r5android-cts-7.1_r4android-cts-7.1_r3android-cts-7.1_r29android-cts-7.1_r28android-cts-7.1_r27android-cts-7.1_r26android-cts-7.1_r25android-cts-7.1_r24android-cts-7.1_r23android-cts-7.1_r22android-cts-7.1_r21android-cts-7.1_r20android-cts-7.1_r2android-cts-7.1_r19android-cts-7.1_r18android-cts-7.1_r17android-cts-7.1_r16android-cts-7.1_r15android-cts-7.1_r14android-cts-7.1_r13android-cts-7.1_r12android-cts-7.1_r11android-cts-7.1_r10android-cts-7.1_r1android-cts-7.0_r9android-cts-7.0_r8android-cts-7.0_r7android-cts-7.0_r6android-cts-7.0_r5android-cts-7.0_r4android-cts-7.0_r33android-cts-7.0_r32android-cts-7.0_r31android-cts-7.0_r30android-cts-7.0_r3android-cts-7.0_r29android-cts-7.0_r28android-cts-7.0_r27android-cts-7.0_r26android-cts-7.0_r25android-cts-7.0_r24android-cts-7.0_r23android-cts-7.0_r22android-cts-7.0_r21android-cts-7.0_r20android-cts-7.0_r2android-cts-7.0_r19android-cts-7.0_r18android-cts-7.0_r17android-cts-7.0_r16android-cts-7.0_r15android-cts-7.0_r14android-cts-7.0_r13android-cts-7.0_r12android-cts-7.0_r11android-cts-7.0_r10android-cts-7.0_r1android-7.1.2_r9android-7.1.2_r8android-7.1.2_r6android-7.1.2_r5android-7.1.2_r4android-7.1.2_r39android-7.1.2_r38android-7.1.2_r37android-7.1.2_r36android-7.1.2_r33android-7.1.2_r32android-7.1.2_r30android-7.1.2_r3android-7.1.2_r29android-7.1.2_r28android-7.1.2_r27android-7.1.2_r25android-7.1.2_r24android-7.1.2_r23android-7.1.2_r2android-7.1.2_r19android-7.1.2_r18android-7.1.2_r17android-7.1.2_r16android-7.1.2_r15android-7.1.2_r14android-7.1.2_r13android-7.1.2_r12android-7.1.2_r11android-7.1.2_r10android-7.1.2_r1android-7.1.1_r9android-7.1.1_r8android-7.1.1_r7android-7.1.1_r61android-7.1.1_r60android-7.1.1_r6android-7.1.1_r59android-7.1.1_r58android-7.1.1_r57android-7.1.1_r56android-7.1.1_r55android-7.1.1_r54android-7.1.1_r53android-7.1.1_r52android-7.1.1_r51android-7.1.1_r50android-7.1.1_r49android-7.1.1_r48android-7.1.1_r47android-7.1.1_r46android-7.1.1_r45android-7.1.1_r44android-7.1.1_r43android-7.1.1_r42android-7.1.1_r41android-7.1.1_r40android-7.1.1_r4android-7.1.1_r39android-7.1.1_r38android-7.1.1_r35android-7.1.1_r33android-7.1.1_r32android-7.1.1_r31android-7.1.1_r3android-7.1.1_r28android-7.1.1_r27android-7.1.1_r26android-7.1.1_r25android-7.1.1_r24android-7.1.1_r23android-7.1.1_r22android-7.1.1_r21android-7.1.1_r20android-7.1.1_r2android-7.1.1_r17android-7.1.1_r16android-7.1.1_r15android-7.1.1_r14android-7.1.1_r13android-7.1.1_r12android-7.1.1_r11android-7.1.1_r10android-7.1.1_r1android-7.1.0_r7android-7.1.0_r6android-7.1.0_r5android-7.1.0_r4android-7.1.0_r3android-7.1.0_r2android-7.1.0_r1android-7.0.0_r9android-7.0.0_r8android-7.0.0_r7android-7.0.0_r6android-7.0.0_r5android-7.0.0_r4android-7.0.0_r36android-7.0.0_r35android-7.0.0_r34android-7.0.0_r33android-7.0.0_r32android-7.0.0_r31android-7.0.0_r30android-7.0.0_r3android-7.0.0_r29android-7.0.0_r28android-7.0.0_r27android-7.0.0_r24android-7.0.0_r21android-7.0.0_r19android-7.0.0_r17android-7.0.0_r15android-7.0.0_r14android-7.0.0_r13android-7.0.0_r12android-7.0.0_r11android-7.0.0_r10android-7.0.0_r1nougat-releasenougat-mr2.3-releasenougat-mr2.2-releasenougat-mr2.1-releasenougat-mr2-security-releasenougat-mr2-releasenougat-mr2-pixel-releasenougat-mr2-devnougat-mr1.8-releasenougat-mr1.7-releasenougat-mr1.6-releasenougat-mr1.5-releasenougat-mr1.4-releasenougat-mr1.3-releasenougat-mr1.2-releasenougat-mr1.1-releasenougat-mr1-volantis-releasenougat-mr1-security-releasenougat-mr1-releasenougat-mr1-flounder-releasenougat-mr1-devnougat-mr1-cts-releasenougat-mr0.5-releasenougat-dr1-releasenougat-devnougat-cts-releasenougat-bugfix-releaseAlex Vakulenko
am: f07ce4ed69 * commit 'f07ce4ed69c3c2624f4aae422d1ed62a8ac7a44c': dbus-binding-generator: Update libchrome APIs to r369476
2016-01-20dbus-binding-generator: Update libchrome APIs to r369476android-n-preview-1brillo-m10-releasebrillo-m10-devAlex Vakulenko
The new libchrome has been ported from Chromium and some APIs have changed. Make necessary changes at call sites. Change-Id: I792e854c58fadce96e153e081fc8fc6e129da6dc
2016-01-04Fix compiler warnings in dbus-binding-generatorChristopher Wiley
am: 4d7450f263 * commit '4d7450f26396d6a5d3135e058873d484c3857aa0': Fix compiler warnings in dbus-binding-generator
2016-01-04Fix compiler warnings in dbus-binding-generatorbrillo-m9-releasebrillo-m9-devChristopher Wiley
Do this for both in repository code and generated code. Bug: 26379019 Test: compiles, unittests pass Change-Id: Ic1e387d914696639c0ad495d3ecb6f0a60bcb981
2015-12-14Match SetPropertyChangedCallback signature in mocked object.Dan Colish
am: 9f6fb89c67 * commit '9f6fb89c67950128c98e723fad5263369f103faf': Match SetPropertyChangedCallback signature in mocked object.
2015-12-14Match SetPropertyChangedCallback signature in mocked object.Dan Colish
BUG: 26092352 Change-Id: Iba1e8cac5707daaf7b09c38af60b46852662c151
2015-12-11Merge "Drop the "-host" suffix on libchrome and libbrillo."Alex Deymo
am: e4ba481e55 * commit 'e4ba481e55e2b0e1cb1fa528005bcfc3da361424': Drop the "-host" suffix on libchrome and libbrillo.
2015-12-11Move SetPropertyChangedCallback to proxy interface and add a mockAlex Vakulenko
am: daea81b234 * commit 'daea81b234ad10d0ecd0410521e517fa89f7b2e0': Move SetPropertyChangedCallback to proxy interface and add a mock
2015-12-10Drop the "-host" suffix on libchrome and libbrillo.Alex Deymo
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)
2015-12-10Merge "Drop the "-host" suffix on libchrome and libbrillo."brillo-m8-releasebrillo-m8-devAlex Deymo
2015-12-10Move SetPropertyChangedCallback to proxy interface and add a mockAlex Vakulenko
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
2015-12-09Drop the "-host" suffix on libchrome and libbrillo.Alex Deymo
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
2015-12-09dbus-binding-generator: Fix mock generation and support for readwrite propsAlex Vakulenko
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
2015-12-08dbus-binding-generator: Use abstract interfaces instead of proxiesAlex Vakulenko
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
2015-10-28chromeos-dbus-bindings: rename libchromeos -> libbrillobrillo-m7-releasebrillo-m7-mr-devbrillo-m7-devAlex Vakulenko
Remaining changes missed in the original CL. BUG: 24872993 Change-Id: Id4ad17d4cc454ff79307a919357cbaf00968ef93
2015-10-27dbus-binding-generator: Rename libchromeos to libbrilloAlex Vakulenko
BUG: 24872993 Change-Id: I02898f06e056ea769fe2509e699f8582975d9ff5
2015-10-13Rename "chromeos" -> "brillo" in include paths and namespacesAlex Vakulenko
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
2015-09-29dbus-binding-generator: build on non-Linux hostsScott James Remnant
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
2015-09-08Revert "chromeos-dbus-bindings: remove object proxy from bus in proxy ↵Peter Qiu
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
2015-08-28chromeos-dbus-bindings: remove object proxy from bus in proxy destructorPeter Qiu
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
2015-08-18dbus-bindings: Fix include path.Bertrand SIMONNET
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
2015-08-12chromeos-dbus-bindings: Literal proxy includes for mocksChristopher Wiley
(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>
2015-08-12chromeos-dbus-bindings: Handle mocks all the way up to eleven.Alex Deymo
(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>
2015-08-04Add Android.mkChristopher Wiley
This includes support to build both the host build tool and the host unittests. Bug: 22608897 Change-Id: Iee07b18be658462fb0549d4c12cae8aae26e8d2d
2015-07-31Merge "Revert "Add Android.mk""Bertrand Simonnet
2015-07-31Revert "Add Android.mk"Bertrand Simonnet
This reverts commit 885fbff615a8a740131bf740812c6ca72ee3c01d. Change-Id: I00b1ae8d77732beb816077b94bf289dae67b31ed
2015-07-30Merge "Look up one more level for common-mk/ directory"Christopher Wiley
2015-07-30Look up one more level for common-mk/ directoryChristopher Wiley
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
2015-07-29Add Android.mkChristopher Wiley
This includes support to build both the host build tool and the host unittests. Bug: 22608897 Change-Id: I23a24f702b7366ce8bbf3e39e9d22345cd57655a
2015-07-29Merge branch 'rewrite-chromeos-dbus-bindings' into merge-chromeos-dbus-bindingsChristopher Wiley
2015-07-29chromeos-dbus-bindings: Move interface virtual destructors to public.Alex Deymo
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>
2015-07-29chromeos-dbus-bindings: Expose Register*Handler() methods in the ↵Alex Deymo
*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>
2015-07-29chromeos-dbus-bindings: Print output diff when failing a test.Alex Deymo
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>
2015-07-28chromeos-dbus-bindings: Fix more sign issuesChristopher Wiley
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>
2015-07-27Add license filesChristopher Wiley
Change-Id: I6588bad92f8f114a1e66f3e73b240ac43e75ed2b
2015-07-25Initial empty repositoryBill Yi
2015-07-24chromeos-dbus-bindings: Fix sign issues in unittestsChristopher Wiley
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>
2015-06-22chromeos-dbus-bindings: Make Interface destructor virtual.Alex Deymo
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>
2015-06-17platform2: Fix issues with new version of libchromeAlex Vakulenko
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>
2015-04-29libchromeos: Replace scoped_ptr with std::unique_ptr in D-Bus method handlersAlex Vakulenko
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>
2015-04-03platform2: Explicitly use base:: namespace with CommandLineAlex Vakulenko
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>
2015-03-29delete __STDC_{FORMAT,LIMIT}_MACROSMike Frysinger
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>
2015-03-15chromeos-dbus-bindings: Correct ObjectManager without service nameChristopher Wiley
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>
2015-03-13libchromeos: Replace char with std::string in string_utils APIVitaly Buka
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>
2015-02-27chromeos-dbus-bindings: Handle all-uppercase identifiers gracefullyAlex Vakulenko
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>
2015-02-25chromeos-dbus-bindings: Generate only single proxy accessor for singletonsAlex Vakulenko
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>
2015-02-25chromeos-dbus-bindings: Generator must expose property name accessorsAlex Vakulenko
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>
2015-02-25chromeos-dbus-bindings: Inline some of named constants in testsAlex Vakulenko
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>
2015-02-25chromeos-dbus-bindings: Add support for dbus::Message in handler paramsAlex Vakulenko
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>
2015-01-22chromeos-dbus-bindings: Added proxy mock generationAlex Vakulenko
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>