Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1749)

Unified Diff: components/image_fetcher/image_data_fetcher_unittest.cc

Issue 2677993002: Use IOSImageDataFetcherWrapper for favicon (Closed)
Patch Set: Actually adding the header Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/image_fetcher/image_data_fetcher_unittest.cc
diff --git a/components/image_fetcher/image_data_fetcher_unittest.cc b/components/image_fetcher/image_data_fetcher_unittest.cc
index 10382231198f6293f447435018c34f16edc1fe98..15039781fb4a9f2fd8f002491c44e16e8e28c2a8 100644
--- a/components/image_fetcher/image_data_fetcher_unittest.cc
+++ b/components/image_fetcher/image_data_fetcher_unittest.cc
@@ -11,6 +11,7 @@
#include "base/memory/ref_counted.h"
#include "base/message_loop/message_loop.h"
#include "net/http/http_response_headers.h"
+#include "net/http/http_status_code.h"
#include "net/url_request/test_url_fetcher_factory.h"
#include "net/url_request/url_request_status.h"
#include "net/url_request/url_request_test_util.h"
@@ -64,6 +65,7 @@ TEST_F(ImageDataFetcherTest, FetchImageData) {
RequestMetadata expected_metadata;
expected_metadata.mime_type = std::string("image/png");
+ expected_metadata.response_code = net::HTTP_OK;
EXPECT_CALL(*this, OnImageDataFetched(std::string(kURLResponseData),
expected_metadata));
@@ -73,6 +75,7 @@ TEST_F(ImageDataFetcherTest, FetchImageData) {
test_url_fetcher->set_status(
net::URLRequestStatus(net::URLRequestStatus::SUCCESS, net::OK));
test_url_fetcher->SetResponseString(kURLResponseData);
+ test_url_fetcher->set_response_code(net::HTTP_OK);
std::string raw_header =
"HTTP/1.1 200 OK\n"
@@ -94,6 +97,7 @@ TEST_F(ImageDataFetcherTest, FetchImageData_NotFound) {
RequestMetadata expected_metadata;
expected_metadata.mime_type = std::string("image/png");
+ expected_metadata.response_code = net::HTTP_NOT_FOUND;
// For 404, expect an empty result even though correct image data is sent.
EXPECT_CALL(*this, OnImageDataFetched(std::string(), expected_metadata));
@@ -124,6 +128,7 @@ TEST_F(ImageDataFetcherTest, FetchImageData_FailedRequest) {
base::Unretained(this)));
RequestMetadata expected_metadata;
+ expected_metadata.response_code = net::URLFetcher::RESPONSE_CODE_INVALID;
EXPECT_CALL(
*this, OnImageDataFetchedFailedRequest(std::string(), expected_metadata));
« no previous file with comments | « components/image_fetcher/image_data_fetcher.cc ('k') | components/image_fetcher/ios/ios_image_data_fetcher_wrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698