AU: Expose the server's HTTP response code in HttpFetcher.
A step towards resolving 2394 -- we'll need to exponentially back
off on 500 and 503 as well as 502 if possible.
BUG=2394
TEST=unit tests, gmerged and made sure updates can happen
Change-Id: I7928e3af37f23ce1ba197315ec52ab0b2ed0dc4c
Review URL: http://codereview.chromium.org/3106038
diff --git a/mock_http_fetcher.cc b/mock_http_fetcher.cc
index 04ec7f6..2e11865 100644
--- a/mock_http_fetcher.cc
+++ b/mock_http_fetcher.cc
@@ -17,6 +17,7 @@
}
void MockHttpFetcher::BeginTransfer(const std::string& url) {
+ http_response_code_ = 0;
if (sent_size_ < data_.size())
SendData(true);
}
@@ -34,7 +35,8 @@
sent_size_ += chunk_size;
CHECK_LE(sent_size_, data_.size());
if (sent_size_ == data_.size()) {
- // We've sent all the data. notify of success
+ // We've sent all the data. Notify of success.
+ http_response_code_ = 200;
delegate_->TransferComplete(this, true);
}
}