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

Unified Diff: chrome/browser/ssl/chrome_expect_ct_reporter_unittest.cc

Issue 2365353004: Add Content-Type header to net::ReportSender reports (Closed)
Patch Set: eroman comment 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
« no previous file with comments | « chrome/browser/ssl/chrome_expect_ct_reporter.cc ('k') | components/certificate_reporting/error_reporter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ssl/chrome_expect_ct_reporter_unittest.cc
diff --git a/chrome/browser/ssl/chrome_expect_ct_reporter_unittest.cc b/chrome/browser/ssl/chrome_expect_ct_reporter_unittest.cc
index a5bdeb3867fb9fa68b4176d3841fd5e801fc64e3..7efa5a13fdca8aeda652d9fae70042519ec9bfcf 100644
--- a/chrome/browser/ssl/chrome_expect_ct_reporter_unittest.cc
+++ b/chrome/browser/ssl/chrome_expect_ct_reporter_unittest.cc
@@ -39,19 +39,24 @@ class TestCertificateReportSender : public net::ReportSender {
~TestCertificateReportSender() override {}
void Send(const GURL& report_uri,
- const std::string& serialized_report) override {
+ base::StringPiece content_type,
+ base::StringPiece serialized_report) override {
latest_report_uri_ = report_uri;
- latest_serialized_report_ = serialized_report;
+ serialized_report.CopyToString(&latest_serialized_report_);
+ content_type.CopyToString(&latest_content_type_);
}
const GURL& latest_report_uri() { return latest_report_uri_; }
+ const std::string& latest_content_type() { return latest_content_type_; }
+
const std::string& latest_serialized_report() {
return latest_serialized_report_;
}
private:
GURL latest_report_uri_;
+ std::string latest_content_type_;
std::string latest_serialized_report_;
};
@@ -478,6 +483,7 @@ TEST(ChromeExpectCTReporterTest, SendReport) {
reporter.OnExpectCTFailed(host_port, report_uri, ssl_info);
EXPECT_EQ(report_uri, sender->latest_report_uri());
EXPECT_FALSE(sender->latest_serialized_report().empty());
+ EXPECT_EQ("application/json; charset=utf-8", sender->latest_content_type());
ASSERT_NO_FATAL_FAILURE(CheckExpectCTReport(
sender->latest_serialized_report(), host_port, ssl_info));
« no previous file with comments | « chrome/browser/ssl/chrome_expect_ct_reporter.cc ('k') | components/certificate_reporting/error_reporter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698