Switch OmahaEvent's error_code to ActionExitCode.
Also, emit the errorcode attribute only for non-success events.
Added explicit unit tests for OmahaEvent.
BUG=560
TEST=unit tests, gmerged on device, forced update, looked at logs.
Review URL: http://codereview.chromium.org/3035007
diff --git a/update_attempter.cc b/update_attempter.cc
index b5d9644..f4b284f 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -116,18 +116,14 @@
shared_ptr<OmahaRequestAction> download_started_action(
new OmahaRequestAction(omaha_request_params_,
new OmahaEvent(
- OmahaEvent::kTypeUpdateDownloadStarted,
- OmahaEvent::kResultSuccess,
- 0),
+ OmahaEvent::kTypeUpdateDownloadStarted),
new LibcurlHttpFetcher));
shared_ptr<DownloadAction> download_action(
new DownloadAction(new LibcurlHttpFetcher));
shared_ptr<OmahaRequestAction> download_finished_action(
new OmahaRequestAction(omaha_request_params_,
new OmahaEvent(
- OmahaEvent::kTypeUpdateDownloadFinished,
- OmahaEvent::kResultSuccess,
- 0),
+ OmahaEvent::kTypeUpdateDownloadFinished),
new LibcurlHttpFetcher));
shared_ptr<PostinstallRunnerAction> postinstall_runner_action_precommit(
new PostinstallRunnerAction(true));
@@ -137,9 +133,7 @@
new PostinstallRunnerAction(false));
shared_ptr<OmahaRequestAction> update_complete_action(
new OmahaRequestAction(omaha_request_params_,
- new OmahaEvent(OmahaEvent::kTypeUpdateComplete,
- OmahaEvent::kResultSuccess,
- 0),
+ new OmahaEvent(OmahaEvent::kTypeUpdateComplete),
new LibcurlHttpFetcher));
download_action->set_delegate(this);