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

Side by Side Diff: chrome/browser/download/download_browsertest.cc

Issue 2675063002: Browser tests for using the new SafeBrowsing protocol (v4) (Closed)
Patch Set: Use ANNOTATE_LEAKING_OBJECT_PTR Created 3 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
« no previous file with comments | « no previous file | chrome/browser/loader/safe_browsing_resource_throttle.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 const CheckDownloadCallback& callback) override { 1076 const CheckDownloadCallback& callback) override {
1077 callback.Run( 1077 callback.Run(
1078 safe_browsing::DownloadProtectionService::UNCOMMON); 1078 safe_browsing::DownloadProtectionService::UNCOMMON);
1079 } 1079 }
1080 }; 1080 };
1081 1081
1082 class FakeSafeBrowsingService 1082 class FakeSafeBrowsingService
1083 : public safe_browsing::TestSafeBrowsingService, 1083 : public safe_browsing::TestSafeBrowsingService,
1084 public safe_browsing::ServicesDelegate::ServicesCreator { 1084 public safe_browsing::ServicesDelegate::ServicesCreator {
1085 public: 1085 public:
1086 FakeSafeBrowsingService() { 1086 FakeSafeBrowsingService()
1087 : TestSafeBrowsingService(
1088 safe_browsing::V4FeatureList::V4UsageStatus::V4_DISABLED) {
1087 services_delegate_ = 1089 services_delegate_ =
1088 safe_browsing::ServicesDelegate::CreateForTest(this, this); 1090 safe_browsing::ServicesDelegate::CreateForTest(this, this);
1089 } 1091 }
1090 1092
1091 protected: 1093 protected:
1092 ~FakeSafeBrowsingService() override {} 1094 ~FakeSafeBrowsingService() override {}
1093 1095
1094 // ServicesDelegate::ServicesCreator: 1096 // ServicesDelegate::ServicesCreator:
1095 bool CanCreateDownloadProtectionService() override { return true; } 1097 bool CanCreateDownloadProtectionService() override { return true; }
1096 bool CanCreateIncidentReportingService() override { return false; } 1098 bool CanCreateIncidentReportingService() override { return false; }
(...skipping 2701 matching lines...) Expand 10 before | Expand all | Expand 10 after
3798 browser(), 1, 3800 browser(), 1,
3799 content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_DENY)); 3801 content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_DENY));
3800 ui_test_utils::NavigateToURL(browser(), extension_url); 3802 ui_test_utils::NavigateToURL(browser(), extension_url);
3801 3803
3802 observer->WaitForFinished(); 3804 observer->WaitForFinished();
3803 3805
3804 // Download shelf should close. 3806 // Download shelf should close.
3805 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible()); 3807 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible());
3806 } 3808 }
3807 #endif // defined(OS_CHROMEOS) 3809 #endif // defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/loader/safe_browsing_resource_throttle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698