| Index: net/url_request/report_sender_unittest.cc
|
| diff --git a/net/url_request/report_sender_unittest.cc b/net/url_request/report_sender_unittest.cc
|
| index 2143fbac8762c318b4f9e482dc66c9b2e70a0e5c..daafab8ded5f4e9dea6c899a682da25bd9f2033f 100644
|
| --- a/net/url_request/report_sender_unittest.cc
|
| +++ b/net/url_request/report_sender_unittest.cc
|
| @@ -87,6 +87,10 @@ class TestReportSenderNetworkDelegate : public NetworkDelegateImpl {
|
| expect_cookies_ = expect_cookies;
|
| }
|
|
|
| + void set_expected_content_type(const std::string& expected_content_type) {
|
| + expected_content_type_ = expected_content_type;
|
| + }
|
| +
|
| // NetworkDelegateImpl implementation.
|
| int OnBeforeURLRequest(URLRequest* request,
|
| const CompletionCallback& callback,
|
| @@ -103,6 +107,15 @@ class TestReportSenderNetworkDelegate : public NetworkDelegateImpl {
|
| EXPECT_TRUE(request->load_flags() & LOAD_DO_NOT_SAVE_COOKIES);
|
| }
|
|
|
| + if (!expected_content_type_.empty()) {
|
| + HttpRequestHeaders headers;
|
| + request->GetFullRequestHeaders(&headers);
|
| + std::string content_type;
|
| + EXPECT_TRUE(
|
| + headers.GetHeader(HttpRequestHeaders::kContentType, &content_type));
|
| + EXPECT_EQ(expected_content_type_, content_type);
|
| + }
|
| +
|
| CheckUploadData(*request, &expect_reports_);
|
|
|
| // Unconditionally return OK, since the sender ignores the results
|
| @@ -123,6 +136,7 @@ class TestReportSenderNetworkDelegate : public NetworkDelegateImpl {
|
| GURL expect_url_;
|
| std::set<std::string> expect_reports_;
|
| bool expect_cookies_;
|
| + std::string expected_content_type_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(TestReportSenderNetworkDelegate);
|
| };
|
|
|