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

Side by Side Diff: chrome/browser/autocomplete/search_provider_unittest.cc

Issue 11275088: Remove implicit scoped_refptr operator T* Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 years, 1 month 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 "chrome/browser/autocomplete/search_provider.h" 5 #include "chrome/browser/autocomplete/search_provider.h"
6 6
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 226
227 // Shutdown the provider before the profile. 227 // Shutdown the provider before the profile.
228 provider_ = NULL; 228 provider_ = NULL;
229 } 229 }
230 230
231 GURL SearchProviderTest::AddSearchToHistory(TemplateURL* t_url, 231 GURL SearchProviderTest::AddSearchToHistory(TemplateURL* t_url,
232 string16 term, 232 string16 term,
233 int visit_count) { 233 int visit_count) {
234 HistoryService* history = 234 HistoryService* history =
235 HistoryServiceFactory::GetForProfile(&profile_, 235 HistoryServiceFactory::GetForProfile(&profile_,
236 Profile::EXPLICIT_ACCESS); 236 Profile::EXPLICIT_ACCESS).get();
237 GURL search(t_url->url_ref().ReplaceSearchTerms( 237 GURL search(t_url->url_ref().ReplaceSearchTerms(
238 TemplateURLRef::SearchTermsArgs(term))); 238 TemplateURLRef::SearchTermsArgs(term)));
239 static base::Time last_added_time; 239 static base::Time last_added_time;
240 last_added_time = std::max(base::Time::Now(), 240 last_added_time = std::max(base::Time::Now(),
241 last_added_time + base::TimeDelta::FromMicroseconds(1)); 241 last_added_time + base::TimeDelta::FromMicroseconds(1));
242 history->AddPageWithDetails(search, string16(), visit_count, visit_count, 242 history->AddPageWithDetails(search, string16(), visit_count, visit_count,
243 last_added_time, false, history::SOURCE_BROWSED); 243 last_added_time, false, history::SOURCE_BROWSED);
244 history->SetKeywordSearchTermsForURL(search, t_url->id(), term); 244 history->SetKeywordSearchTermsForURL(search, t_url->id(), term);
245 return search; 245 return search;
246 } 246 }
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after
1253 EXPECT_EQ(AutocompleteMatch::ACMatchClassification::URL, 1253 EXPECT_EQ(AutocompleteMatch::ACMatchClassification::URL,
1254 match.contents_class[0].style); 1254 match.contents_class[0].style);
1255 EXPECT_EQ(4U, match.contents_class[1].offset); 1255 EXPECT_EQ(4U, match.contents_class[1].offset);
1256 EXPECT_EQ(AutocompleteMatch::ACMatchClassification::URL | 1256 EXPECT_EQ(AutocompleteMatch::ACMatchClassification::URL |
1257 AutocompleteMatch::ACMatchClassification::MATCH, 1257 AutocompleteMatch::ACMatchClassification::MATCH,
1258 match.contents_class[1].style); 1258 match.contents_class[1].style);
1259 EXPECT_EQ(5U, match.contents_class[2].offset); 1259 EXPECT_EQ(5U, match.contents_class[2].offset);
1260 EXPECT_EQ(AutocompleteMatch::ACMatchClassification::URL, 1260 EXPECT_EQ(AutocompleteMatch::ACMatchClassification::URL,
1261 match.contents_class[2].style); 1261 match.contents_class[2].style);
1262 } 1262 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/search_provider.cc ('k') | chrome/browser/autocomplete/shortcuts_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698