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