p2p: Add HttpPeer to DownloadSource enumeration
This way the Installer.DownloadSourcesUsed metric conveys how often
p2p is used and new metrics Installer.SuccessfulMBsDownloadedFromHttpPeer
and Installer.TotalMBsDownloadedFromHttpPeer gives additional detail.
BUG=chromium:284714
TEST=modify unit tests to cover this case + unit tests pass
Change-Id: Ia4dff090091a282e1a184c2b18f8290749f5fdeb
Reviewed-on: https://chromium-review.googlesource.com/167913
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: David Zeuthen <zeuthen@chromium.org>
Tested-by: David Zeuthen <zeuthen@chromium.org>
diff --git a/mock_payload_state.h b/mock_payload_state.h
index 2e8536a..4e21a0f 100644
--- a/mock_payload_state.h
+++ b/mock_payload_state.h
@@ -31,8 +31,9 @@
MOCK_METHOD0(Rollback, void());
MOCK_METHOD1(ExpectRebootInNewVersion,
void(const std::string& target_version_uid));
- MOCK_METHOD0(GetP2PNumAttempts, int());
- MOCK_METHOD0(GetP2PFirstAttemptTimestamp, base::Time());
+ MOCK_METHOD0(P2PNewAttempt, void());
+ MOCK_METHOD0(P2PAttemptAllowed, bool());
+ MOCK_METHOD1(SetUsingP2PForDownloading, void(bool));
// Getters.
MOCK_METHOD0(GetResponseSignature, std::string());
@@ -49,8 +50,9 @@
MOCK_METHOD1(GetTotalBytesDownloaded, uint64_t(DownloadSource source));
MOCK_METHOD0(GetNumReboots, uint32_t());
MOCK_METHOD0(GetRollbackVersion, std::string());
- MOCK_METHOD0(P2PNewAttempt, void());
- MOCK_METHOD0(P2PAttemptAllowed, bool());
+ MOCK_METHOD0(GetP2PNumAttempts, int());
+ MOCK_METHOD0(GetP2PFirstAttemptTimestamp, base::Time());
+ MOCK_METHOD0(GetUsingP2PForDownloading, bool());
};
} // namespace chromeos_update_engine