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

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

Issue 18878007: Omnibox: Make the Controller Reorder Matches for Inlining (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 4 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/builtin_provider.h" 5 #include "chrome/browser/autocomplete/builtin_provider.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/autocomplete/autocomplete_input.h" 9 #include "chrome/browser/autocomplete/autocomplete_input.h"
10 #include "chrome/browser/autocomplete/autocomplete_match.h" 10 #include "chrome/browser/autocomplete/autocomplete_match.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 false, true, AutocompleteInput::ALL_MATCHES); 57 false, true, AutocompleteInput::ALL_MATCHES);
58 builtin_provider_->Start(input, false); 58 builtin_provider_->Start(input, false);
59 EXPECT_TRUE(builtin_provider_->done()); 59 EXPECT_TRUE(builtin_provider_->done());
60 matches = builtin_provider_->matches(); 60 matches = builtin_provider_->matches();
61 EXPECT_EQ(builtin_cases[i].num_results, matches.size()) << 61 EXPECT_EQ(builtin_cases[i].num_results, matches.size()) <<
62 ASCIIToUTF16("Input was: ") << builtin_cases[i].input; 62 ASCIIToUTF16("Input was: ") << builtin_cases[i].input;
63 if (matches.size() == builtin_cases[i].num_results) { 63 if (matches.size() == builtin_cases[i].num_results) {
64 for (size_t j = 0; j < builtin_cases[i].num_results; ++j) { 64 for (size_t j = 0; j < builtin_cases[i].num_results; ++j) {
65 EXPECT_EQ(builtin_cases[i].output[j], matches[j].*member) << 65 EXPECT_EQ(builtin_cases[i].output[j], matches[j].*member) <<
66 ASCIIToUTF16("Input was: ") << builtin_cases[i].input; 66 ASCIIToUTF16("Input was: ") << builtin_cases[i].input;
67 EXPECT_FALSE(matches[j].allowed_to_be_default_match);
67 } 68 }
68 } 69 }
69 } 70 }
70 } 71 }
71 72
72 TEST_F(BuiltinProviderTest, TypingScheme) { 73 TEST_F(BuiltinProviderTest, TypingScheme) {
73 const string16 kAbout = ASCIIToUTF16(chrome::kAboutScheme); 74 const string16 kAbout = ASCIIToUTF16(chrome::kAboutScheme);
74 const string16 kChrome = ASCIIToUTF16(chrome::kChromeUIScheme); 75 const string16 kChrome = ASCIIToUTF16(chrome::kChromeUIScheme);
75 const string16 kSeparator1 = ASCIIToUTF16(":"); 76 const string16 kSeparator1 = ASCIIToUTF16(":");
76 const string16 kSeparator2 = ASCIIToUTF16(":/"); 77 const string16 kSeparator2 = ASCIIToUTF16(":/");
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 {kSettings + kPage1.substr(0, 2), 1, {kURL1}}, 210 {kSettings + kPage1.substr(0, 2), 1, {kURL1}},
210 {kSettings + kPage1.substr(0, kPage1.length() - 1), 1, {kURL1}}, 211 {kSettings + kPage1.substr(0, kPage1.length() - 1), 1, {kURL1}},
211 {kSettings + kPage1, 1, {kURL1}}, 212 {kSettings + kPage1, 1, {kURL1}},
212 {kSettings + kPage2, 1, {kURL2}}, 213 {kSettings + kPage2, 1, {kURL2}},
213 }; 214 };
214 215
215 RunTest<GURL>(settings_subpage_cases, arraysize(settings_subpage_cases), 216 RunTest<GURL>(settings_subpage_cases, arraysize(settings_subpage_cases),
216 &AutocompleteMatch::destination_url); 217 &AutocompleteMatch::destination_url);
217 } 218 }
218 #endif 219 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698