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/safe_browsing/download_protection_service.h" | 5 #include "chrome/browser/safe_browsing/download_protection_service.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
(...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1283 redirects.push_back(GURL("http://tab.com/ref1")); | 1283 redirects.push_back(GURL("http://tab.com/ref1")); |
1284 redirects.push_back(GURL("http://tab.com/ref2")); | 1284 redirects.push_back(GURL("http://tab.com/ref2")); |
1285 redirects.push_back(tab_url); | 1285 redirects.push_back(tab_url); |
1286 HistoryServiceFactory::GetForProfile(&profile, Profile::EXPLICIT_ACCESS) | 1286 HistoryServiceFactory::GetForProfile(&profile, Profile::EXPLICIT_ACCESS) |
1287 ->AddPage(tab_url, | 1287 ->AddPage(tab_url, |
1288 base::Time::Now(), | 1288 base::Time::Now(), |
1289 reinterpret_cast<history::ContextID>(1), | 1289 reinterpret_cast<history::ContextID>(1), |
1290 0, | 1290 0, |
1291 GURL(), | 1291 GURL(), |
1292 redirects, | 1292 redirects, |
1293 content::PAGE_TRANSITION_TYPED, | 1293 ui::PAGE_TRANSITION_TYPED, |
1294 history::SOURCE_BROWSED, | 1294 history::SOURCE_BROWSED, |
1295 false); | 1295 false); |
1296 | 1296 |
1297 TestURLFetcherWatcher fetcher_watcher(&factory); | 1297 TestURLFetcherWatcher fetcher_watcher(&factory); |
1298 download_service_->CheckClientDownload( | 1298 download_service_->CheckClientDownload( |
1299 &item, | 1299 &item, |
1300 base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback, | 1300 base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback, |
1301 base::Unretained(this))); | 1301 base::Unretained(this))); |
1302 #if !defined(OS_WIN) && !defined(OS_MACOSX) | 1302 #if !defined(OS_WIN) && !defined(OS_MACOSX) |
1303 // SendRequest is not called. Wait for FinishRequest to call our callback. | 1303 // SendRequest is not called. Wait for FinishRequest to call our callback. |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1584 EXPECT_THAT(whitelist_strings, ElementsAre(cert_base + "/OU=unit")); | 1584 EXPECT_THAT(whitelist_strings, ElementsAre(cert_base + "/OU=unit")); |
1585 | 1585 |
1586 cert = ReadTestCertificate("test_c.pem"); | 1586 cert = ReadTestCertificate("test_c.pem"); |
1587 ASSERT_TRUE(cert.get()); | 1587 ASSERT_TRUE(cert.get()); |
1588 whitelist_strings.clear(); | 1588 whitelist_strings.clear(); |
1589 GetCertificateWhitelistStrings( | 1589 GetCertificateWhitelistStrings( |
1590 *cert.get(), *issuer_cert.get(), &whitelist_strings); | 1590 *cert.get(), *issuer_cert.get(), &whitelist_strings); |
1591 EXPECT_THAT(whitelist_strings, ElementsAre()); | 1591 EXPECT_THAT(whitelist_strings, ElementsAre()); |
1592 } | 1592 } |
1593 } // namespace safe_browsing | 1593 } // namespace safe_browsing |
OLD | NEW |