AU: Implement exponential back off for 500 and 503 HTTP response codes.
Also refactors the automatic update checks into a separate
scheduler class and adds unit tests for them.
update_check_scheduler.cc 59 / 59: 100.0%
update_check_scheduler.h 1 / 1: 100.0%
Note: because the unit tests for this CL use the
UpdateAttempter class, the CL brings in several untested
modules into the test report reducing the overall test
coverage to ~82%.
BUG=2394
TEST=unit tests, gmerged on device and inspected logs
Change-Id: I078b1727b5338f6fc34e51f5e04a375518d63cef
Review URL: http://codereview.chromium.org/3215006
diff --git a/update_attempter_mock.h b/update_attempter_mock.h
new file mode 100644
index 0000000..56a0b42
--- /dev/null
+++ b/update_attempter_mock.h
@@ -0,0 +1,24 @@
+// Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_UPDATE_ATTEMPTER_MOCK_H__
+#define CHROMEOS_PLATFORM_UPDATE_ENGINE_UPDATE_ATTEMPTER_MOCK_H__
+
+#include <gmock/gmock.h>
+
+#include "update_engine/update_attempter.h"
+
+namespace chromeos_update_engine {
+
+class UpdateAttempterMock : public UpdateAttempter {
+ public:
+ UpdateAttempterMock() : UpdateAttempter(NULL, NULL) {}
+
+ MOCK_METHOD2(Update, void(const std::string& app_version,
+ const std::string& omaha_url));
+};
+
+} // namespace chromeos_update_engine
+
+#endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_UPDATE_ATTEMPTER_MOCK_H__