| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/ui/views/omnibox/omnibox_view_views.h" | 5 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/search_engines/template_url_service_factory.h" | 8 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_commands.h" | 10 #include "chrome/browser/ui/browser_commands.h" |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 AutocompleteResult& results = autocomplete_controller->result_; | 304 AutocompleteResult& results = autocomplete_controller->result_; |
| 305 ACMatches matches; | 305 ACMatches matches; |
| 306 AutocompleteMatch match; | 306 AutocompleteMatch match; |
| 307 match.destination_url = GURL("http://autocomplete-result/"); | 307 match.destination_url = GURL("http://autocomplete-result/"); |
| 308 match.allowed_to_be_default_match = true; | 308 match.allowed_to_be_default_match = true; |
| 309 match.type = AutocompleteMatchType::HISTORY_TITLE; | 309 match.type = AutocompleteMatchType::HISTORY_TITLE; |
| 310 match.relevance = 500; | 310 match.relevance = 500; |
| 311 matches.push_back(match); | 311 matches.push_back(match); |
| 312 match.destination_url = GURL("http://autocomplete-result2/"); | 312 match.destination_url = GURL("http://autocomplete-result2/"); |
| 313 matches.push_back(match); | 313 matches.push_back(match); |
| 314 results.AppendMatches(matches); | 314 results.AppendMatches(AutocompleteInput(), matches); |
| 315 results.SortAndCull( | 315 results.SortAndCull( |
| 316 AutocompleteInput(), | 316 AutocompleteInput(), |
| 317 TemplateURLServiceFactory::GetForProfile(browser()->profile())); | 317 TemplateURLServiceFactory::GetForProfile(browser()->profile())); |
| 318 | 318 |
| 319 // The omnibox popup should open with suggestions displayed. | 319 // The omnibox popup should open with suggestions displayed. |
| 320 omnibox_view->model()->popup_model()->OnResultChanged(); | 320 omnibox_view->model()->popup_model()->OnResultChanged(); |
| 321 EXPECT_TRUE(omnibox_view->model()->popup_model()->IsOpen()); | 321 EXPECT_TRUE(omnibox_view->model()->popup_model()->IsOpen()); |
| 322 | 322 |
| 323 // The omnibox text should be selected. | 323 // The omnibox text should be selected. |
| 324 EXPECT_TRUE(omnibox_view->IsSelectAll()); | 324 EXPECT_TRUE(omnibox_view->IsSelectAll()); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 // TextInputFocusManager completes. | 384 // TextInputFocusManager completes. |
| 385 chrome::FocusLocationBar(browser()); | 385 chrome::FocusLocationBar(browser()); |
| 386 OmniboxView* view = NULL; | 386 OmniboxView* view = NULL; |
| 387 ASSERT_NO_FATAL_FAILURE(GetOmniboxViewForBrowser(browser(), &view)); | 387 ASSERT_NO_FATAL_FAILURE(GetOmniboxViewForBrowser(browser(), &view)); |
| 388 OmniboxViewViews* omnibox_view_views = static_cast<OmniboxViewViews*>(view); | 388 OmniboxViewViews* omnibox_view_views = static_cast<OmniboxViewViews*>(view); |
| 389 ui::TextInputFocusManager* text_input_focus_manager = | 389 ui::TextInputFocusManager* text_input_focus_manager = |
| 390 ui::TextInputFocusManager::GetInstance(); | 390 ui::TextInputFocusManager::GetInstance(); |
| 391 EXPECT_EQ(omnibox_view_views->GetTextInputClient(), | 391 EXPECT_EQ(omnibox_view_views->GetTextInputClient(), |
| 392 text_input_focus_manager->GetFocusedTextInputClient()); | 392 text_input_focus_manager->GetFocusedTextInputClient()); |
| 393 } | 393 } |
| OLD | NEW |