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

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

Issue 12623029: Upstreaming mechanism to add query refinement to omnibox searches. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Applied Peter's comments. Created 7 years, 9 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) 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/contact_provider_chromeos.h" 5 #include "chrome/browser/autocomplete/contact_provider_chromeos.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 contact_provider_ = 61 contact_provider_ =
62 new ContactProvider(NULL, profile_, contact_manager_->GetWeakPtr()); 62 new ContactProvider(NULL, profile_, contact_manager_->GetWeakPtr());
63 } 63 }
64 64
65 // Starts a (synchronous) query for |utf8_text| in |contact_provider_|. 65 // Starts a (synchronous) query for |utf8_text| in |contact_provider_|.
66 void StartQuery(const std::string& utf8_text) { 66 void StartQuery(const std::string& utf8_text) {
67 contact_provider_->Start( 67 contact_provider_->Start(
68 AutocompleteInput(UTF8ToUTF16(utf8_text), 68 AutocompleteInput(UTF8ToUTF16(utf8_text),
69 string16::npos, // cursor_position 69 string16::npos, // cursor_position
70 string16(), // desired_tld 70 string16(), // desired_tld
71 GURL(), // current_url
71 false, // prevent_inline_autocomplete 72 false, // prevent_inline_autocomplete
72 false, // prefer_keyword 73 false, // prefer_keyword
73 false, // allow_exact_keyword_match 74 false, // allow_exact_keyword_match
74 AutocompleteInput::ALL_MATCHES), 75 AutocompleteInput::ALL_MATCHES),
75 false); // minimal_changes 76 false); // minimal_changes
76 } 77 }
77 78
78 // Returns the contact ID in |match|'s additional info, or an empty string if 79 // Returns the contact ID in |match|'s additional info, or an empty string if
79 // no ID is present. 80 // no ID is present.
80 std::string GetContactIdFromMatch(const AutocompleteMatch& match) { 81 std::string GetContactIdFromMatch(const AutocompleteMatch& match) {
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 EXPECT_EQ(exp_contact.contact_id(), match_id) 272 EXPECT_EQ(exp_contact.contact_id(), match_id)
272 << "Expected contact ID " << exp_contact.contact_id() 273 << "Expected contact ID " << exp_contact.contact_id()
273 << " for match " << i << " but got " << match_id << " instead"; 274 << " for match " << i << " but got " << match_id << " instead";
274 if (i > 0) { 275 if (i > 0) {
275 EXPECT_LE(matches[i].relevance, previous_relevance) 276 EXPECT_LE(matches[i].relevance, previous_relevance)
276 << "Match " << i << " has greater relevance than previous match"; 277 << "Match " << i << " has greater relevance than previous match";
277 } 278 }
278 previous_relevance = matches[i].relevance; 279 previous_relevance = matches[i].relevance;
279 } 280 }
280 } 281 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698