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

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

Issue 1117173004: Split cert reporter class into report building/serializing and sending (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: document parse/serialize return value Created 5 years, 7 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: chrome/browser/ssl/chrome_fraudulent_certificate_reporter_unittest.cc
diff --git a/chrome/browser/net/chrome_fraudulent_certificate_reporter_unittest.cc b/chrome/browser/ssl/chrome_fraudulent_certificate_reporter_unittest.cc
similarity index 91%
rename from chrome/browser/net/chrome_fraudulent_certificate_reporter_unittest.cc
rename to chrome/browser/ssl/chrome_fraudulent_certificate_reporter_unittest.cc
index f3ecf4812197fa766d2d5ba9c979fc960b7291c4..a9b64fc01b35fdacad781e9a075e079b4adb4da6 100644
--- a/chrome/browser/net/chrome_fraudulent_certificate_reporter_unittest.cc
+++ b/chrome/browser/ssl/chrome_fraudulent_certificate_reporter_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h"
+#include "chrome/browser/ssl/chrome_fraudulent_certificate_reporter.h"
#include <string>
@@ -26,10 +26,11 @@
#include "net/url_request/url_request_test_util.h"
#include "testing/gtest/include/gtest/gtest.h"
+using chrome_browser_net::CertificateErrorReporter;
using content::BrowserThread;
using net::SSLInfo;
-namespace chrome_browser_net {
+namespace chrome_browser_ssl {
// Builds an SSLInfo from an invalid cert chain. In this case, the cert is
// expired; what matters is that the cert would not pass even a normal
@@ -38,8 +39,8 @@ namespace chrome_browser_net {
static SSLInfo GetBadSSLInfo() {
SSLInfo info;
- info.cert = net::ImportCertFromFile(net::GetTestCertsDirectory(),
- "expired_cert.pem");
+ info.cert =
+ net::ImportCertFromFile(net::GetTestCertsDirectory(), "expired_cert.pem");
info.cert_status = net::CERT_STATUS_DATE_INVALID;
info.is_issued_by_known_root = false;
@@ -124,19 +125,16 @@ class MockReporter : public CertificateErrorReporter {
CertificateErrorReporter::DO_NOT_SEND_COOKIES) {}
void SendReport(ReportType type,
- const std::string& hostname,
- const net::SSLInfo& ssl_info) override {
+ const std::string& serialized_report) override {
EXPECT_EQ(type, REPORT_TYPE_PINNING_VIOLATION);
- EXPECT_FALSE(hostname.empty());
- EXPECT_TRUE(ssl_info.is_valid());
- CertificateErrorReporter::SendReport(type, hostname, ssl_info);
+ EXPECT_FALSE(serialized_report.empty());
+ CertificateErrorReporter::SendReport(type, serialized_report);
}
private:
scoped_ptr<net::URLRequest> CreateURLRequest(
net::URLRequestContext* context) override {
- return context->CreateRequest(GURL(std::string()),
- net::DEFAULT_PRIORITY,
+ return context->CreateRequest(GURL(std::string()), net::DEFAULT_PRIORITY,
NULL);
}
};
@@ -192,4 +190,4 @@ TEST(ChromeFraudulentCertificateReporterTest, ReportIsNotSent) {
loop.RunUntilIdle();
}
-} // namespace chrome_browser_net
+} // namespace chrome_browser_ssl

Powered by Google App Engine
This is Rietveld 408576698