History log of /external/dbus-binding-generator/chromeos-dbus-bindings/adaptor_generator_unittest.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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/adaptor_generator_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/adaptor_generator_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/adaptor_generator_unittest.cc
6cc1d5b99f6994832595c4d0a788972e65a6ef54 25-Apr-2015 Alex Vakulenko <avakulenko@chromium.org> libchromeos: Replace scoped_ptr with std::unique_ptr in D-Bus method handlers

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>
/external/dbus-binding-generator/chromeos-dbus-bindings/adaptor_generator_unittest.cc
59dd2e90057686c1fc7978456e9b24b9688146c4 24-Feb-2015 Alex Vakulenko <avakulenko@chromium.org> chromeos-dbus-bindings: Generator must expose property name accessors

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>
/external/dbus-binding-generator/chromeos-dbus-bindings/adaptor_generator_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/adaptor_generator_unittest.cc
1b4882c32998b6ae9d4e29ea5ac44e36d22e2ae7 23-Feb-2015 Alex Vakulenko <avakulenko@chromium.org> chromeos-dbus-bindings: Add support for dbus::Message in handler params

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>
/external/dbus-binding-generator/chromeos-dbus-bindings/adaptor_generator_unittest.cc
f3c689780c9c0cc5fd1630f01ee05060bb696403 10-Dec-2014 Alex Vakulenko <avakulenko@chromium.org> Update libchrome to r307740 and fix build errors

Updated libchrome, libchrome_crypto, metrics, feedback to the
latest revisions from Chrome (r307740).

Fixed build breaks due to the changes in upstream code:

- scope_ptr no longer needs explicit PassAs<T>() calls.
- scope_ptr<T> no longer has implicit conversion to T*.
Must use scope_ptr<T>::get() instead.
- base/file_util.h moved to base/files/file_util.h
- ARRAYSIZE_UNSAFE() removed in favor of arraysize()
- base::AppendToFile() and base::WriteFileDescriptor() now
return bool instead of the number of bytes written.
- dbus::Bus::AddFilterFunction() now returns void.
- C++11 features are enabled in libchromeos, so all targets
linking with it now have to support C++11
- OVERRIDE macro is removed in favor of native C++11
'override' keyword.

BUG=chromium:416628, chromium:411508
TEST=Build the world on x86, x64, ARM. The following builders
were tried:
x86-generic-full amd64-generic-full arm-generic-full
amd64-generic-asan daisy-full nyan-full pre-cq-group
daisy-release-group sandybridge-release-group
pineview-release-group
CQ-DEPEND=CL:234450,CL:234980

Change-Id: I374bebe2211d533c4431c82efb8be1cdcb1f405d
Reviewed-on: https://chromium-review.googlesource.com/234440
Reviewed-by: Bertrand Simonnet <bsimonnet@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
/external/dbus-binding-generator/chromeos-dbus-bindings/adaptor_generator_unittest.cc
1f19109f49760b81f955c4b56ecc0529d83dd569 10-Dec-2014 Peter Qiu <zqiu@chromium.org> chromeos-dbus-bindings: write access property support

DBus properties are default to read-only, so update the access mode
for properties that have write access. Also set the validator callback
for those properties as well.

Applications can override the validate method to provide their own
implementation for verifying the value for each writable property.

BUG=chromium:440139
TEST=USE="asan clang" FEATURES=test emerge-$BOARD libchromeos buffet
apmanager peerd

Change-Id: I3c8fd90218bb194f86fad7e9d76ff51f0e0861ec
Reviewed-on: https://chromium-review.googlesource.com/234281
Reviewed-by: Peter Qiu <zqiu@chromium.org>
Commit-Queue: Peter Qiu <zqiu@chromium.org>
Tested-by: Peter Qiu <zqiu@chromium.org>
/external/dbus-binding-generator/chromeos-dbus-bindings/adaptor_generator_unittest.cc
0a86514094bf9ed17f7cd576a41edf723d4a7b30 26-Nov-2014 Alex Vakulenko <avakulenko@chromium.org> chromeos-dbus-bindings: Minor code formatting and comment fixes

Made minor code formatting changes to the generated code and fixed
comment generation from <tp:docstring> element to maintain relative
in-comment indentation as seen in peerd's Service.xml file.

So the comment tag like this:
<tp:docstring>
A list of IP addresses, each composed of:
- an array of bytes containing the octets of the IP
address (either an IPv4 or an IPv6 address)
- a 16 bit port number.
</tp:docstring>

Would become a code comment like this:

// A list of IP addresses, each composed of:
// - an array of bytes containing the octets of the IP
// address (either an IPv4 or an IPv6 address)
// - a 16 bit port number.

BUG=None
TEST=FEATURES=test emerge-link chromeos-dbus-bindings
Manually inspect the generated proxy/adapters for
existing components (buffet, peerd, privetd).

Change-Id: I794533a26a75991a9a89382f185df721a1b53793
Reviewed-on: https://chromium-review.googlesource.com/232060
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Vitaly Buka <vitalybuka@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
/external/dbus-binding-generator/chromeos-dbus-bindings/adaptor_generator_unittest.cc
6ef2d737ce25f4c0debcf87d5f5909289ce15adf 25-Nov-2014 Alex Vakulenko <avakulenko@chromium.org> chromeos-dbus-bindings: Use object path and service name in generated code

To eliminate unnecessary dependencies on string constants from D-Bus
service providers, allow generated proxies extract fixed object paths
from the 'name' attribute of <node> in the XML file (if available) and
be able to pass in additional the D-Bus service configuration parameters
(such as D-Bus service name) as input to the generator, so that the proxy
code knows these values too and the caller doesn't have to provide this
information.

With these changes the object path and/or service names become embedded
into the generated proxies and are no longer required to be provided as
parameters to the constructors. If there are multiple instances of D-Bus
objects with the same interface are available (or the object could
appear at different bus paths), the path cannot be embedded into
the proxy and must still be provided in the constructor of the generated
class.

The service config can now be provided in --service-config=... argument
to the generator which is expected to be a JSON file.
If the service name it is not specified, the generated proxy code will
require this parameter in the constructor call, as before.

Also updated other targets that use the proxy generator to follow the
new constructor syntax (buffet, peerd, privetd).

BUG=chromium:431737
TEST=FEATURES=test emerge-link chromeos-dbus-bindings peerd buffet privetd

Change-Id: I4bb8387a9b21b75e3508fa13d14b79fbe653c929
Reviewed-on: https://chromium-review.googlesource.com/231920
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Vitaly Buka <vitalybuka@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
/external/dbus-binding-generator/chromeos-dbus-bindings/adaptor_generator_unittest.cc
4f3c05eed11d5f1e279313bafb1d8d693774d35f 13-Nov-2014 Alex Vakulenko <avakulenko@chromium.org> chromeos-dbus-bindings: Add support for STRUCT and typed async methods

The async method handlers in libchromeos have been changed to use
strongly typed response objects. This change mainly changes the
adapter generator to produce the correct signatures for the async
adapter methods.

In the attempt to support existing XML files from shill and
modemmanager I implemented some features that are required there:

1. Allow nested <node> elements (which are still ignored but at
least parsing of XML files doesn't fail.
2. Add support for <tp:docstring> element to extract comments
from interface/method/signal/property definitions and add
then to adaptor/proxy code which should help user to make
sense of method intentions.
3. Added support for STRUCT D-Bus types (...). Now using
std::tuple<> to represent D-Bus structures.
4. a{sv} are converted to chromeos::VariantDictionary instead of
std::map<std::string, chromeos::Any> which is shorter and
being very popular type in D-Bus, makes a few generated
function signatures neater.
5. Added support for "org.freedesktop.DBus.GLib.Async" annotation
to be an alias for "org.chromium.DBus.Method.Kind"="async".
6. Fixed chromeos::string_utils::Split() to eliminate empty
strings if they were created by trimming all-whitespace
elements of the split array.

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

Change-Id: I73cf13819128ca5fca9e9188d162d120b737cf1f
Reviewed-on: https://chromium-review.googlesource.com/229430
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
/external/dbus-binding-generator/chromeos-dbus-bindings/adaptor_generator_unittest.cc
fafef1300f94cada37c4fac0e0c7ba46aeee5ad1 03-Nov-2014 Alex Vakulenko <avakulenko@chromium.org> chromeos-dbus-bindings: Redesign due to underlying DBusObject change.

DBusObject method handlers have been changed to allow for async
method handlers. D-Bus proxy generator is changing accordingly
to reflect the underlying implementation change.

Now it is possible to generate asyc-ready method handlers by
adding annotations to the method elements in the source XML file.
With the "org.chromium.DBus.Method.Kind" attribute on a method
description element, you can now control which of the four
supported method handers are to be used:

- "normal" (default): the handler signature is as follows:

bool Handler(ErrorPtr* error, const Type1& in1, const Type2& in2, ...
Type3* out1, Type4* out2, ...);

- "simple": the handler does not fail and hence does not return
any error information. One of the following two signatures:

RetType Handler(const Type1& in1, const Type2& in2, ...);
void Handler(const Type1& in1, const Type2& in2, ...,
Type3* out1, Type4* out2, ...);

- "async": is a possibly asynchronous method handler:

void Handler(scoped_ptr<DBusMethodResponse> response,
const Type1& in1, const Type2& in2, ...);

- "raw": the fully custom specialty handler that allows
raw implementation of D-Bus method with no additional framework:

void Handler(dbus::MethodCall* method_call, ResponseSender sender);

As part of this change, it was also possible to provide implementations
for methods returning more than one value.

A method element can also specify that the method handler can be
marked as 'const' in the C++ adapter by adding the following attribute
with the value of "true": "org.chromium.DBus.Method.Const"

Another significant change to the D-Bus binding generator is the
support of multiple interfaces per D-Bus object. Now the XML file
can list multiple <interface> tags for a class node. This makes the
generator to create the abstract C++ interface adaptors that contain
protorypes for all the methods, signals and properties for that interface.

The final interface implementation class derives from one or more adaptor(s)
and implements the actual interface methods.

Finally, updated lorgnette to use the new generated adaptor for its
D-Bus interfaces.

BUG=chromium:419271, chromium:420925, chromium:428390
TEST=FEATURES=test emerge-link chromeos-dbus-bindings

Change-Id: I02d1fc2e21a230e0f4c959c54ed7c71490945b12
Reviewed-on: https://chromium-review.googlesource.com/227281
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
/external/dbus-binding-generator/chromeos-dbus-bindings/adaptor_generator_unittest.cc
dd885751db1da01f14c873484e1344378614108a 03-Nov-2014 Peter Qiu <zqiu@chromium.org> chromeos-dbus-bindings: Add support for DBus Property

It is desired to have this tool auto generate codes for DBus Property,
both registering property to the DBus interface and prvoiding accessor
functions for the property. This make adding DBus property much easier
for the application developers.

The accessor functions are named based on the property name (GetPropertyName
and SetPropertyName). So the developer doesn't need to know the actual
variable name being used.

Note that DBus spec requires the user to specify access permission for the
property, which is not currently supported by chrome-dbus (always read/write
with write operation not supported). So this attribute is currently a noop.

Example:
<property name="InterfaceName" type="s" access="read"/>

dbus_interface_->AddProperty
"InterfaceName",
&interface_name_);

std::string GetInterfaceName() const {
return interface_name_.GetValue.Get<std::string>();
}
void SetInterfaceName(
const std::string& interface_name) {
interface_name_.SetValue(interface_name);
}

chromeos::dbus_utils::ExportedProperty<std::string>
interface_name_;

BUG=chromium:429027
TEST=unittests, emerge apmanager with DBus property binding

Change-Id: Ib05af799afdbe63d740c75196f6967b2b11f1748
Reviewed-on: https://chromium-review.googlesource.com/226946
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Peter Qiu <zqiu@chromium.org>
Tested-by: Peter Qiu <zqiu@chromium.org>
/external/dbus-binding-generator/chromeos-dbus-bindings/adaptor_generator_unittest.cc
b19e92f93f5cd73fa19a65f6a5b2205fe47fc41c 24-Oct-2014 Alex Deymo <deymo@chromium.org> chromeos-dbus-bindings: Add support for sending signals from the adaptor.

This patch creates helper methods in the Adaptor to send the defined
signals with the right signature.

BUG=chromium:426531
TEST=Unittests

Change-Id: Ib9b9c2bc125a3edbff368d3a2bccb80ba06ba089
Reviewed-on: https://chromium-review.googlesource.com/225306
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
/external/dbus-binding-generator/chromeos-dbus-bindings/adaptor_generator_unittest.cc
a6153c9c655b30ebf4046c8f59ba3fdfddf885cd 23-Oct-2014 Paul Stewart <pstew@chromium.org> chromeos-dbus-bindings: Add bus parameter to adaptor constructor

Take both an object manager and bus pointer For callers who wish
not to use an object manager.

BUG=chromium:426408
TEST=Unit tests + compile lorgnette

Change-Id: I74d0405e0122ac058430c06d001076d3edcc1fde
Reviewed-on: https://chromium-review.googlesource.com/225157
Reviewed-by: Alex Deymo <deymo@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
/external/dbus-binding-generator/chromeos-dbus-bindings/adaptor_generator_unittest.cc
1dce1ae6ca266668e37d6bc4009692bbc12e2bb6 01-Oct-2014 Paul Stewart <pstew@chromium.org> chromeos-dbus-bindings: Create proxy generator

Consolidate common functions to a parent HeaderGenerator class,
and create a new ProxyGenerator class. This new class converts
from native C++ method calls to D-Bus method invocations. It
also takes an interface class (populated with default null
implementations) for all signals supported by the interface.

CQ-DEPEND=CL:221015
BUG=chromium:404505
TEST=New unit test

Change-Id: Id6ed1f6f6e0868f32911a96e23e3dc74c9df0212
Reviewed-on: https://chromium-review.googlesource.com/221365
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/external/dbus-binding-generator/chromeos-dbus-bindings/adaptor_generator_unittest.cc
99010b6c94b0bdf45cca07e60cb6795dca94d031 02-Oct-2014 Paul Stewart <pstew@chromium.org> chromeos-dbus-bindings: Leave method interface unadorned

Do not prefix the adaptor method interface with a class name.
Since it is wrapped in the adaptor, it is unambiguous to just
call it MethodInterface.

BUG=None
TEST=Unit test, rebuild platform2

Change-Id: Idaaab1291fbbb1d153050f8f82ff087633fcc12f
Reviewed-on: https://chromium-review.googlesource.com/221232
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
/external/dbus-binding-generator/chromeos-dbus-bindings/adaptor_generator_unittest.cc
8d62c293a157f403668a590f4ca20d60e33a5a55 01-Oct-2014 Paul Stewart <pstew@chromium.org> chromeos-dbus-bindings: Ignore multi-return methods

Multiple return arguments are legal in D-Bus. Instead of throwing
a fatal error, ignore methods of this sort in the adaptor
generator, since libchromeos currently cannot automatically
generate returns for such methods.

While here, provide a protected getter to the DBus interface
pointer, so subclasses can register their own methods.

BUG=chromium:419271
TEST=Modified unit tests

Change-Id: Idd4ed43ee4cb8fa4249d666d85cadcb465c39cc1
Reviewed-on: https://chromium-review.googlesource.com/220750
Reviewed-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/external/dbus-binding-generator/chromeos-dbus-bindings/adaptor_generator_unittest.cc
b9b3f9d3654f15b221f47f5f24bd874102a27ed2 11-Sep-2014 Paul Stewart <pstew@chromium.org> chromeos-dbus-bindings: Generate Interface

Generate an interface class that contains pure-virtual methods
for each method supported by the interface. Also generate a
controller that registers these methods with an exported DBus
interface.

BUG=chromium:404505
TEST=New unit test

Change-Id: Ib9eacdd822982e6e992d10fc21a4eec804489b45
Reviewed-on: https://chromium-review.googlesource.com/218749
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/external/dbus-binding-generator/chromeos-dbus-bindings/adaptor_generator_unittest.cc