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

Side by Side Diff: chrome/browser/safe_browsing/threat_details_unittest.cc

Issue 2660333007: Enable NTPTilesInInstantService by default (Closed)
Patch Set: fix tests 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
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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 typedef SafeBrowsingUIManager::UnsafeResource UnsafeResource; 200 typedef SafeBrowsingUIManager::UnsafeResource UnsafeResource;
201 201
202 ThreatDetailsTest() : ui_manager_(new MockSafeBrowsingUIManager()) {} 202 ThreatDetailsTest() : ui_manager_(new MockSafeBrowsingUIManager()) {}
203 203
204 void SetUp() override { 204 void SetUp() override {
205 ChromeRenderViewHostTestHarness::SetUp(); 205 ChromeRenderViewHostTestHarness::SetUp();
206 ASSERT_TRUE(profile()->CreateHistoryService(true /* delete_file */, 206 ASSERT_TRUE(profile()->CreateHistoryService(true /* delete_file */,
207 false /* no_db */)); 207 false /* no_db */));
208 } 208 }
209 209
210 void TearDown() override {
211 profile()->DestroyHistoryService();
212 ChromeRenderViewHostTestHarness::TearDown();
213 }
214
215 static bool ResourceLessThan( 210 static bool ResourceLessThan(
216 const ClientSafeBrowsingReportRequest::Resource* lhs, 211 const ClientSafeBrowsingReportRequest::Resource* lhs,
217 const ClientSafeBrowsingReportRequest::Resource* rhs) { 212 const ClientSafeBrowsingReportRequest::Resource* rhs) {
218 return lhs->id() < rhs->id(); 213 return lhs->id() < rhs->id();
219 } 214 }
220 215
221 std::string WaitForSerializedReport(ThreatDetails* report, 216 std::string WaitForSerializedReport(ThreatDetails* report,
222 bool did_proceed, 217 bool did_proceed,
223 int num_visit) { 218 int num_visit) {
224 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, 219 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after
979 pb_resource->set_parent_id(3); 974 pb_resource->set_parent_id(3);
980 pb_resource->set_url(kSecondRedirectURL); 975 pb_resource->set_url(kSecondRedirectURL);
981 pb_resource = expected.add_resources(); 976 pb_resource = expected.add_resources();
982 pb_resource->set_id(3); 977 pb_resource->set_id(3);
983 pb_resource->set_url(kFirstRedirectURL); 978 pb_resource->set_url(kFirstRedirectURL);
984 979
985 VerifyResults(actual, expected); 980 VerifyResults(actual, expected);
986 } 981 }
987 982
988 } // namespace safe_browsing 983 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc ('k') | chrome/browser/search/instant_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698