update_engine: Use powerd for rebooting.
Make update_engine call powerd's RequestRestart method to
restart the system instead of running "shutdown -r now"
directly. This avoids races where Chrome asks powerd to shut
down the system but then update_engine sees that an update
has been applied and reboots it instead.
BUG=chromium:372074
TEST=applied an update and requested a reboot from the UI;
checked that the request was logged by powerd. held the
power button to shut down while an update was pending
and checked that the system shut down instead of
rebooting. built update_engine with the
power_management USE flag unset and checked that it was
still able to reboot the system.
CQ-DEPEND=I73f67cca9875b00bd944e4ff9779ad24fc4cd738
CQ-DEPEND=I2888fdde50a71460b74f2ef33d63ac00c5938626
Change-Id: Ic5f7c33c3f7fc5fe92ac8a2e1800830678cac235
Reviewed-on: https://chromium-review.googlesource.com/206074
Tested-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Daniel Erat <derat@chromium.org>
diff --git a/mock_dbus_wrapper.h b/mock_dbus_wrapper.h
index 569e289..444d0d8 100644
--- a/mock_dbus_wrapper.h
+++ b/mock_dbus_wrapper.h
@@ -26,6 +26,10 @@
const char *method,
GError **error,
GHashTable** out1));
+ MOCK_METHOD4(ProxyCall_1_0, gboolean(DBusGProxy *proxy,
+ const char *method,
+ GError **error,
+ gint in1));
MOCK_METHOD6(ProxyCall_3_0, gboolean(DBusGProxy* proxy,
const char* method,
GError** error,