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/download/download_browsertest.h" | 5 #include "chrome/browser/download/download_browsertest.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <sstream> | 8 #include <sstream> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1078 const CheckDownloadCallback& callback) override { | 1078 const CheckDownloadCallback& callback) override { |
1079 callback.Run( | 1079 callback.Run( |
1080 safe_browsing::DownloadProtectionService::UNCOMMON); | 1080 safe_browsing::DownloadProtectionService::UNCOMMON); |
1081 } | 1081 } |
1082 }; | 1082 }; |
1083 | 1083 |
1084 class FakeSafeBrowsingService | 1084 class FakeSafeBrowsingService |
1085 : public safe_browsing::TestSafeBrowsingService, | 1085 : public safe_browsing::TestSafeBrowsingService, |
1086 public safe_browsing::ServicesDelegate::ServicesCreator { | 1086 public safe_browsing::ServicesDelegate::ServicesCreator { |
1087 public: | 1087 public: |
1088 FakeSafeBrowsingService() { | 1088 FakeSafeBrowsingService() |
| 1089 : TestSafeBrowsingService(safe_browsing::V4UsageStatus::V4_DISABLED) { |
1089 services_delegate_ = | 1090 services_delegate_ = |
1090 safe_browsing::ServicesDelegate::CreateForTest(this, this); | 1091 safe_browsing::ServicesDelegate::CreateForTest(this, this); |
1091 } | 1092 } |
1092 | 1093 |
1093 protected: | 1094 protected: |
1094 ~FakeSafeBrowsingService() override {} | 1095 ~FakeSafeBrowsingService() override {} |
1095 | 1096 |
1096 // ServicesDelegate::ServicesCreator: | 1097 // ServicesDelegate::ServicesCreator: |
1097 bool CanCreateDownloadProtectionService() override { return true; } | 1098 bool CanCreateDownloadProtectionService() override { return true; } |
1098 bool CanCreateIncidentReportingService() override { return false; } | 1099 bool CanCreateIncidentReportingService() override { return false; } |
(...skipping 2701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3800 browser(), 1, | 3801 browser(), 1, |
3801 content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_DENY)); | 3802 content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_DENY)); |
3802 ui_test_utils::NavigateToURL(browser(), extension_url); | 3803 ui_test_utils::NavigateToURL(browser(), extension_url); |
3803 | 3804 |
3804 observer->WaitForFinished(); | 3805 observer->WaitForFinished(); |
3805 | 3806 |
3806 // Download shelf should close. | 3807 // Download shelf should close. |
3807 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible()); | 3808 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible()); |
3808 } | 3809 } |
3809 #endif // defined(OS_CHROMEOS) | 3810 #endif // defined(OS_CHROMEOS) |
OLD | NEW |