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

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

Issue 8375039: Create a content::UrlFetcher interface that lives in content/public/common and convert users to i... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: review comments Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/string_util.h" 7 #include "base/string_util.h"
8 #include "base/time.h" 8 #include "base/time.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 QueryForInput(term, false); 252 QueryForInput(term, false);
253 253
254 // Make sure the default providers suggest service was queried. 254 // Make sure the default providers suggest service was queried.
255 TestURLFetcher* fetcher = test_factory_.GetFetcherByID( 255 TestURLFetcher* fetcher = test_factory_.GetFetcherByID(
256 SearchProvider::kDefaultProviderURLFetcherID); 256 SearchProvider::kDefaultProviderURLFetcherID);
257 ASSERT_TRUE(fetcher); 257 ASSERT_TRUE(fetcher);
258 258
259 // And the URL matches what we expected. 259 // And the URL matches what we expected.
260 GURL expected_url = GURL(default_t_url_->suggestions_url()-> 260 GURL expected_url = GURL(default_t_url_->suggestions_url()->
261 ReplaceSearchTerms(*default_t_url_, term, 0, string16())); 261 ReplaceSearchTerms(*default_t_url_, term, 0, string16()));
262 ASSERT_TRUE(fetcher->original_url() == expected_url); 262 ASSERT_TRUE(fetcher->GetOriginalUrl() == expected_url);
263 263
264 // Tell the SearchProvider the suggest query is done. 264 // Tell the SearchProvider the suggest query is done.
265 fetcher->set_response_code(200); 265 fetcher->set_response_code(200);
266 fetcher->delegate()->OnURLFetchComplete(fetcher); 266 fetcher->delegate()->OnURLFetchComplete(fetcher);
267 fetcher = NULL; 267 fetcher = NULL;
268 268
269 // Run till the history results complete. 269 // Run till the history results complete.
270 RunTillProviderDone(); 270 RunTillProviderDone();
271 271
272 // The SearchProvider is done. Make sure it has a result for the history 272 // The SearchProvider is done. Make sure it has a result for the history
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 default_fetcher = NULL; 312 default_fetcher = NULL;
313 313
314 // Make sure the keyword providers suggest service was queried. 314 // Make sure the keyword providers suggest service was queried.
315 TestURLFetcher* keyword_fetcher = test_factory_.GetFetcherByID( 315 TestURLFetcher* keyword_fetcher = test_factory_.GetFetcherByID(
316 SearchProvider::kKeywordProviderURLFetcherID); 316 SearchProvider::kKeywordProviderURLFetcherID);
317 ASSERT_TRUE(keyword_fetcher); 317 ASSERT_TRUE(keyword_fetcher);
318 318
319 // And the URL matches what we expected. 319 // And the URL matches what we expected.
320 GURL expected_url = GURL(keyword_t_url_->suggestions_url()-> 320 GURL expected_url = GURL(keyword_t_url_->suggestions_url()->
321 ReplaceSearchTerms(*keyword_t_url_, term, 0, string16())); 321 ReplaceSearchTerms(*keyword_t_url_, term, 0, string16()));
322 ASSERT_TRUE(keyword_fetcher->original_url() == expected_url); 322 ASSERT_TRUE(keyword_fetcher->GetOriginalUrl() == expected_url);
323 323
324 // Tell the SearchProvider the keyword suggest query is done. 324 // Tell the SearchProvider the keyword suggest query is done.
325 keyword_fetcher->set_response_code(200); 325 keyword_fetcher->set_response_code(200);
326 keyword_fetcher->delegate()->OnURLFetchComplete(keyword_fetcher); 326 keyword_fetcher->delegate()->OnURLFetchComplete(keyword_fetcher);
327 keyword_fetcher = NULL; 327 keyword_fetcher = NULL;
328 328
329 // Run till the history results complete. 329 // Run till the history results complete.
330 RunTillProviderDone(); 330 RunTillProviderDone();
331 331
332 // The SearchProvider is done. Make sure it has a result for the history 332 // The SearchProvider is done. Make sure it has a result for the history
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 fetcher = NULL; 654 fetcher = NULL;
655 655
656 // Run till the history results complete. 656 // Run till the history results complete.
657 RunTillProviderDone(); 657 RunTillProviderDone();
658 658
659 // Make sure there is a match for 'a.com' and it doesn't have a template_url. 659 // Make sure there is a match for 'a.com' and it doesn't have a template_url.
660 AutocompleteMatch nav_match; 660 AutocompleteMatch nav_match;
661 EXPECT_TRUE(FindMatchWithDestination(GURL("http://a.com"), &nav_match)); 661 EXPECT_TRUE(FindMatchWithDestination(GURL("http://a.com"), &nav_match));
662 EXPECT_FALSE(nav_match.template_url); 662 EXPECT_FALSE(nav_match.template_url);
663 } 663 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/search_provider.cc ('k') | chrome/browser/autofill/autofill_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698