OLD | NEW |
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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 browser()->profile(), ServiceAccessType::EXPLICIT_ACCESS)); | 137 browser()->profile(), ServiceAccessType::EXPLICIT_ACCESS)); |
138 | 138 |
139 LocationBar* location_bar = GetLocationBar(); | 139 LocationBar* location_bar = GetLocationBar(); |
140 OmniboxView* omnibox_view = location_bar->GetOmniboxView(); | 140 OmniboxView* omnibox_view = location_bar->GetOmniboxView(); |
141 AutocompleteController* autocomplete_controller = GetAutocompleteController(); | 141 AutocompleteController* autocomplete_controller = GetAutocompleteController(); |
142 | 142 |
143 { | 143 { |
144 omnibox_view->model()->SetInputInProgress(true); | 144 omnibox_view->model()->SetInputInProgress(true); |
145 autocomplete_controller->Start(AutocompleteInput( | 145 autocomplete_controller->Start(AutocompleteInput( |
146 base::ASCIIToUTF16("chrome"), base::string16::npos, std::string(), | 146 base::ASCIIToUTF16("chrome"), base::string16::npos, std::string(), |
147 GURL(), metrics::OmniboxEventProto::NTP, true, false, true, false, | 147 GURL(), base::string16(), metrics::OmniboxEventProto::NTP, true, false, |
148 false, ChromeAutocompleteSchemeClassifier(browser()->profile()))); | 148 true, false, false, |
| 149 ChromeAutocompleteSchemeClassifier(browser()->profile()))); |
149 | 150 |
150 EXPECT_TRUE(autocomplete_controller->done()); | 151 EXPECT_TRUE(autocomplete_controller->done()); |
151 EXPECT_FALSE(location_bar->GetDestinationURL().is_valid()); | 152 EXPECT_FALSE(location_bar->GetDestinationURL().is_valid()); |
152 EXPECT_TRUE(omnibox_view->GetText().empty()); | 153 EXPECT_TRUE(omnibox_view->GetText().empty()); |
153 EXPECT_TRUE(omnibox_view->IsSelectAll()); | 154 EXPECT_TRUE(omnibox_view->IsSelectAll()); |
154 const AutocompleteResult& result = autocomplete_controller->result(); | 155 const AutocompleteResult& result = autocomplete_controller->result(); |
155 ASSERT_GE(result.size(), 1U) << AutocompleteResultAsString(result); | 156 ASSERT_GE(result.size(), 1U) << AutocompleteResultAsString(result); |
156 AutocompleteMatch match = result.match_at(0); | 157 AutocompleteMatch match = result.match_at(0); |
157 EXPECT_EQ(AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED, match.type); | 158 EXPECT_EQ(AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED, match.type); |
158 EXPECT_FALSE(match.deletable); | 159 EXPECT_FALSE(match.deletable); |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 location_bar->FocusSearch(); | 342 location_bar->FocusSearch(); |
342 EXPECT_FALSE(location_bar->GetDestinationURL().is_valid()); | 343 EXPECT_FALSE(location_bar->GetDestinationURL().is_valid()); |
343 EXPECT_EQ(base::string16(), omnibox_view->GetText()); | 344 EXPECT_EQ(base::string16(), omnibox_view->GetText()); |
344 EXPECT_EQ(default_search_keyword, omnibox_model->keyword()); | 345 EXPECT_EQ(default_search_keyword, omnibox_model->keyword()); |
345 EXPECT_FALSE(omnibox_model->is_keyword_hint()); | 346 EXPECT_FALSE(omnibox_model->is_keyword_hint()); |
346 EXPECT_TRUE(omnibox_model->is_keyword_selected()); | 347 EXPECT_TRUE(omnibox_model->is_keyword_selected()); |
347 | 348 |
348 omnibox_view->RevertAll(); | 349 omnibox_view->RevertAll(); |
349 } | 350 } |
350 } | 351 } |
OLD | NEW |