update_engine: Migrate UE DBus service to chrome DBus bindings.
chromeos-dbus-bindings now generates the adaptor interface that
update_engine exposes over DBus. This interface is implemented in
dbus_service.{h,cc}, which now has a UpdateEngineService class
encapsulating all the service methods implementation.
This allows to write unit test for those methods, which are included
in this CL for all the non-trivial methods.
This CL now uses chrome's DBus bindings for the update_engine serive,
but the proxy interaction is still done using dbus-glib. The main loop
in the main.cc file is now replaced with the chromeos::Dameon, which
uses a chromeos::BaseMessageLoop instead of a GlibMessageLoop. This
causes the asynchronous interactions in the proxy side to not work,
which will be fixed in the next CL.
CQ-DEPEND=CL:290990,CL:291092,CL:293334
BUG=chromium:419827
TEST=Added unittest for all dbus_service methods. deployed and tested manually that update_engine dbus interface works.
Change-Id: I6a6d142b2ac1a61a4c3abcb927665b26114abe5c
Reviewed-on: https://chromium-review.googlesource.com/225324
Reviewed-by: Gilad Arnold <garnold@chromium.org>
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>
diff --git a/update_engine.gyp b/update_engine.gyp
index f377500..1ddb4d9 100644
--- a/update_engine.gyp
+++ b/update_engine.gyp
@@ -59,19 +59,17 @@
],
'includes': ['../common-mk/protoc.gypi'],
},
- # D-Bus glib bindings.
+ # Chrome D-Bus bindings.
{
- 'target_name': 'update_engine-dbus-server',
+ 'target_name': 'update_engine-dbus-adaptor',
'type': 'none',
'variables': {
- 'dbus_glib_type': 'server',
- 'dbus_glib_out_dir': 'include/update_engine',
- 'dbus_glib_prefix': 'update_engine_service',
+ 'dbus_adaptors_out_dir': 'include/update_engine/dbus_adaptor',
},
'sources': [
'dbus_bindings/org.chromium.UpdateEngineInterface.xml',
],
- 'includes': ['../common-mk/dbus_glib.gypi'],
+ 'includes': ['../common-mk/generate-dbus-adaptors.gypi'],
},
# The main static_library with all the code.
{
@@ -125,6 +123,7 @@
'clock.cc',
'connection_manager.cc',
'constants.cc',
+ 'daemon.cc',
'dbus_service.cc',
'delta_performer.cc',
'download_action.cc',
@@ -191,7 +190,7 @@
'type': 'executable',
'dependencies': [
'libupdate_engine',
- 'update_engine-dbus-server',
+ 'update_engine-dbus-adaptor',
],
'sources': [
'main.cc',
@@ -369,6 +368,7 @@
'certificate_checker_unittest.cc',
'chrome_browser_proxy_resolver_unittest.cc',
'connection_manager_unittest.cc',
+ 'dbus_service_unittest.cc',
'delta_performer_unittest.cc',
'download_action_unittest.cc',
'extent_writer_unittest.cc',