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

Unified Diff: chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc

Issue 11347005: Change SafeBrowsingProtocolManager::GetFullHash signature. (Closed) Base URL: http://git.chromium.org/chromium/src.git@in_progress
Patch Set: Fix browser_tests after rebase Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
index f8330c2370b7195242e6c6ed25c3b9a5c31c3111..44849fb62c7b65c8758d753264d40413bfd7a413 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
@@ -49,6 +49,16 @@ using ::testing::_;
using ::testing::Mock;
using ::testing::StrictMock;
+namespace {
+
+void InvokeFullHashCallback(
+ SafeBrowsingProtocolManager::FullHashCallback callback,
+ const std::vector<SBFullHashResult>& result) {
+ callback.Run(result, true);
+}
+
+} // namespace
+
// A SafeBrowingDatabase class that allows us to inject the malicious URLs.
class TestSafeBrowsingDatabase : public SafeBrowsingDatabase {
public:
@@ -205,7 +215,6 @@ class TestProtocolManager : public SafeBrowsingProtocolManager {
net::URLRequestContextGetter* request_context_getter,
const SafeBrowsingProtocolConfig& config)
: SafeBrowsingProtocolManager(sb_service, request_context_getter, config),
- sb_service_(sb_service),
delay_ms_(0) {
create_count_++;
}
@@ -219,14 +228,13 @@ class TestProtocolManager : public SafeBrowsingProtocolManager {
// We return a result from the prefilled full_hashes_ hash_map to simulate
// server's response. At the same time, latency is added to simulate real
// life network issues.
- virtual void GetFullHash(SafeBrowsingService::SafeBrowsingCheck* check,
- const std::vector<SBPrefix>& prefixes) OVERRIDE {
- // When we get a valid response, always cache the result.
- bool cancache = true;
+ virtual void GetFullHash(
+ const std::vector<SBPrefix>& prefixes,
+ SafeBrowsingProtocolManager::FullHashCallback callback,
+ bool is_download) OVERRIDE {
BrowserThread::PostDelayedTask(
BrowserThread::IO, FROM_HERE,
- base::Bind(&SafeBrowsingService::HandleGetHashResults,
- sb_service_, check, full_hashes_, cancache),
+ base::Bind(InvokeFullHashCallback, callback, full_hashes_),
base::TimeDelta::FromMilliseconds(delay_ms_));
}
@@ -250,7 +258,6 @@ class TestProtocolManager : public SafeBrowsingProtocolManager {
private:
std::vector<SBFullHashResult> full_hashes_;
- SafeBrowsingService* sb_service_;
int64 delay_ms_;
static int create_count_;
static int delete_count_;
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698