AU: Start an UpdateAttempter unit test suite.
This increases the UpdateAttmpter line coverage to almost 40%. More is needed
but this is a good starting point / checkpoint. Also some UpdateCheckScheduler
unit test cleanup.
BUG=6243
TEST=unit tests, gmerge on device
Change-Id: I39c80de3f18095c4a28cb36ab868bed6d7073824
Review URL: http://codereview.chromium.org/3259011
diff --git a/update_attempter.h b/update_attempter.h
index fd9bc2a..6a81ef2 100644
--- a/update_attempter.h
+++ b/update_attempter.h
@@ -12,6 +12,7 @@
#include <vector>
#include <glib.h>
+#include <gtest/gtest_prod.h> // for FRIEND_TEST
#include "base/time.h"
#include "update_engine/action_processor.h"
@@ -104,6 +105,9 @@
void BytesReceived(uint64_t bytes_received, uint64_t total);
private:
+ friend class UpdateAttempterTest;
+ FRIEND_TEST(UpdateAttempterTest, UpdateTest);
+
// Sets the status to the given status and notifies a status update
// over dbus.
void SetStatusAndNotify(UpdateStatus status);
@@ -144,7 +148,7 @@
base::TimeTicks last_notify_time_;
std::vector<std::tr1::shared_ptr<AbstractAction> > actions_;
- ActionProcessor processor_;
+ scoped_ptr<ActionProcessor> processor_;
// If non-null, this UpdateAttempter will send status updates over this
// dbus service.