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

Unified Diff: components/certificate_reporting/error_reporter_unittest.cc

Issue 2365353004: Add Content-Type header to net::ReportSender reports (Closed)
Patch Set: make content type a required parameter to Send() Created 4 years, 3 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/certificate_reporting/error_reporter_unittest.cc
diff --git a/components/certificate_reporting/error_reporter_unittest.cc b/components/certificate_reporting/error_reporter_unittest.cc
index 6398c5fc180be55af13e7cda98dd511ba7ddf99e..56b93c082e5919e6f4502a228e4e56137325b50e 100644
--- a/components/certificate_reporting/error_reporter_unittest.cc
+++ b/components/certificate_reporting/error_reporter_unittest.cc
@@ -42,18 +42,24 @@ class MockCertificateReportSender : public net::ReportSender {
: net::ReportSender(nullptr, DO_NOT_SEND_COOKIES) {}
~MockCertificateReportSender() override {}
- void Send(const GURL& report_uri, const std::string& report) override {
+ void Send(const GURL& report_uri,
+ const std::string& content_type,
+ const std::string& report) override {
latest_report_uri_ = report_uri;
latest_report_ = report;
+ latest_content_type_ = content_type;
}
const GURL& latest_report_uri() { return latest_report_uri_; }
const std::string& latest_report() { return latest_report_; }
+ const std::string& latest_content_type() { return latest_content_type_; }
+
private:
GURL latest_report_uri_;
std::string latest_report_;
+ std::string latest_content_type_;
DISALLOW_COPY_AND_ASSIGN(MockCertificateReportSender);
};
@@ -121,6 +127,8 @@ TEST_F(ErrorReporterTest, ExtendedReportingSendReport) {
http_reporter.SendExtendedReportingReport(kDummyReport);
EXPECT_EQ(http_mock_report_sender->latest_report_uri(), http_url);
+ EXPECT_EQ("application/octet-stream",
+ http_mock_report_sender->latest_content_type());
std::string uploaded_report;
EncryptedCertLoggerRequest encrypted_request;

Powered by Google App Engine
This is Rietveld 408576698