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

Side by Side Diff: chrome/browser/net/chrome_fraudulent_certificate_reporter_unittest.cc

Issue 12212048: Linux/ChromeOS Chromium style checker cleanup, chrome/browser edition. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/file_path.h" 10 #include "base/file_path.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 : ChromeFraudulentCertificateReporter(request_context) {} 137 : ChromeFraudulentCertificateReporter(request_context) {}
138 138
139 virtual net::URLRequest* CreateURLRequest( 139 virtual net::URLRequest* CreateURLRequest(
140 net::URLRequestContext* context) OVERRIDE { 140 net::URLRequestContext* context) OVERRIDE {
141 return new MockURLRequest(context); 141 return new MockURLRequest(context);
142 } 142 }
143 143
144 virtual void SendReport( 144 virtual void SendReport(
145 const std::string& hostname, 145 const std::string& hostname,
146 const net::SSLInfo& ssl_info, 146 const net::SSLInfo& ssl_info,
147 bool sni_available) { 147 bool sni_available) OVERRIDE {
148 DCHECK(!hostname.empty()); 148 DCHECK(!hostname.empty());
149 DCHECK(ssl_info.is_valid()); 149 DCHECK(ssl_info.is_valid());
150 ChromeFraudulentCertificateReporter::SendReport(hostname, ssl_info, 150 ChromeFraudulentCertificateReporter::SendReport(hostname, ssl_info,
151 sni_available); 151 sni_available);
152 } 152 }
153 }; 153 };
154 154
155 static void DoReportIsSent() { 155 static void DoReportIsSent() {
156 ChromeURLRequestContext context(ChromeURLRequestContext::CONTEXT_TYPE_MAIN, 156 ChromeURLRequestContext context(ChromeURLRequestContext::CONTEXT_TYPE_MAIN,
157 NULL); 157 NULL);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 } 199 }
200 200
201 TEST(ChromeFraudulentCertificateReporterTest, ReportIsNotSent) { 201 TEST(ChromeFraudulentCertificateReporterTest, ReportIsNotSent) {
202 MessageLoop loop(MessageLoop::TYPE_IO); 202 MessageLoop loop(MessageLoop::TYPE_IO);
203 content::TestBrowserThread io_thread(BrowserThread::IO, &loop); 203 content::TestBrowserThread io_thread(BrowserThread::IO, &loop);
204 loop.PostTask(FROM_HERE, base::Bind(&DoReportIsNotSent)); 204 loop.PostTask(FROM_HERE, base::Bind(&DoReportIsNotSent));
205 loop.RunUntilIdle(); 205 loop.RunUntilIdle();
206 } 206 }
207 207
208 } // namespace chrome_browser_net 208 } // namespace chrome_browser_net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698