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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 | 178 |
179 TEST(ChromeFraudulentCertificateReporterTest, GoodBadInfo) { | 179 TEST(ChromeFraudulentCertificateReporterTest, GoodBadInfo) { |
180 SSLInfo good = GetGoodSSLInfo(); | 180 SSLInfo good = GetGoodSSLInfo(); |
181 EXPECT_TRUE(IsGoodSSLInfo(good)); | 181 EXPECT_TRUE(IsGoodSSLInfo(good)); |
182 | 182 |
183 SSLInfo bad = GetBadSSLInfo(); | 183 SSLInfo bad = GetBadSSLInfo(); |
184 EXPECT_FALSE(IsGoodSSLInfo(bad)); | 184 EXPECT_FALSE(IsGoodSSLInfo(bad)); |
185 } | 185 } |
186 | 186 |
187 TEST(ChromeFraudulentCertificateReporterTest, ReportIsSent) { | 187 TEST(ChromeFraudulentCertificateReporterTest, ReportIsSent) { |
188 base::MessageLoop loop(base::MessageLoop::TYPE_IO); | 188 base::MessageLoopForIO loop; |
189 content::TestBrowserThread io_thread(BrowserThread::IO, &loop); | 189 content::TestBrowserThread io_thread(BrowserThread::IO, &loop); |
190 loop.PostTask(FROM_HERE, base::Bind(&DoReportIsSent)); | 190 loop.PostTask(FROM_HERE, base::Bind(&DoReportIsSent)); |
191 loop.RunUntilIdle(); | 191 loop.RunUntilIdle(); |
192 } | 192 } |
193 | 193 |
194 TEST(ChromeFraudulentCertificateReporterTest, MockReportIsSent) { | 194 TEST(ChromeFraudulentCertificateReporterTest, MockReportIsSent) { |
195 base::MessageLoop loop(base::MessageLoop::TYPE_IO); | 195 base::MessageLoopForIO loop; |
196 content::TestBrowserThread io_thread(BrowserThread::IO, &loop); | 196 content::TestBrowserThread io_thread(BrowserThread::IO, &loop); |
197 loop.PostTask(FROM_HERE, base::Bind(&DoMockReportIsSent)); | 197 loop.PostTask(FROM_HERE, base::Bind(&DoMockReportIsSent)); |
198 loop.RunUntilIdle(); | 198 loop.RunUntilIdle(); |
199 } | 199 } |
200 | 200 |
201 TEST(ChromeFraudulentCertificateReporterTest, ReportIsNotSent) { | 201 TEST(ChromeFraudulentCertificateReporterTest, ReportIsNotSent) { |
202 base::MessageLoop loop(base::MessageLoop::TYPE_IO); | 202 base::MessageLoopForIO loop; |
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 |
OLD | NEW |