| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" | 5 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 EXPECT_FALSE(hostname.empty()); | 127 EXPECT_FALSE(hostname.empty()); |
| 128 EXPECT_TRUE(ssl_info.is_valid()); | 128 EXPECT_TRUE(ssl_info.is_valid()); |
| 129 CertificateErrorReporter::SendReport(type, hostname, ssl_info); | 129 CertificateErrorReporter::SendReport(type, hostname, ssl_info); |
| 130 } | 130 } |
| 131 | 131 |
| 132 private: | 132 private: |
| 133 scoped_ptr<net::URLRequest> CreateURLRequest( | 133 scoped_ptr<net::URLRequest> CreateURLRequest( |
| 134 net::URLRequestContext* context) override { | 134 net::URLRequestContext* context) override { |
| 135 return context->CreateRequest(GURL(std::string()), | 135 return context->CreateRequest(GURL(std::string()), |
| 136 net::DEFAULT_PRIORITY, | 136 net::DEFAULT_PRIORITY, |
| 137 NULL, | |
| 138 NULL); | 137 NULL); |
| 139 } | 138 } |
| 140 }; | 139 }; |
| 141 | 140 |
| 142 static void DoReportIsSent() { | 141 static void DoReportIsSent() { |
| 143 net::TestURLRequestContext context; | 142 net::TestURLRequestContext context; |
| 144 SendingTestReporter reporter(&context); | 143 SendingTestReporter reporter(&context); |
| 145 SSLInfo info = GetGoodSSLInfo(); | 144 SSLInfo info = GetGoodSSLInfo(); |
| 146 reporter.SendReport("mail.google.com", info); | 145 reporter.SendReport("mail.google.com", info); |
| 147 } | 146 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 } | 183 } |
| 185 | 184 |
| 186 TEST(ChromeFraudulentCertificateReporterTest, ReportIsNotSent) { | 185 TEST(ChromeFraudulentCertificateReporterTest, ReportIsNotSent) { |
| 187 base::MessageLoopForIO loop; | 186 base::MessageLoopForIO loop; |
| 188 content::TestBrowserThread io_thread(BrowserThread::IO, &loop); | 187 content::TestBrowserThread io_thread(BrowserThread::IO, &loop); |
| 189 loop.PostTask(FROM_HERE, base::Bind(&DoReportIsNotSent)); | 188 loop.PostTask(FROM_HERE, base::Bind(&DoReportIsNotSent)); |
| 190 loop.RunUntilIdle(); | 189 loop.RunUntilIdle(); |
| 191 } | 190 } |
| 192 | 191 |
| 193 } // namespace chrome_browser_net | 192 } // namespace chrome_browser_net |
| OLD | NEW |