| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 AutocompleteMatch match; | 314 AutocompleteMatch match; |
| 315 match.destination_url = GURL("http://autocomplete-result/"); | 315 match.destination_url = GURL("http://autocomplete-result/"); |
| 316 match.allowed_to_be_default_match = true; | 316 match.allowed_to_be_default_match = true; |
| 317 match.type = AutocompleteMatchType::HISTORY_TITLE; | 317 match.type = AutocompleteMatchType::HISTORY_TITLE; |
| 318 match.relevance = 500; | 318 match.relevance = 500; |
| 319 matches.push_back(match); | 319 matches.push_back(match); |
| 320 match.destination_url = GURL("http://autocomplete-result2/"); | 320 match.destination_url = GURL("http://autocomplete-result2/"); |
| 321 matches.push_back(match); | 321 matches.push_back(match); |
| 322 const AutocompleteInput input( | 322 const AutocompleteInput input( |
| 323 base::ASCIIToUTF16("a"), base::string16::npos, std::string(), GURL(), | 323 base::ASCIIToUTF16("a"), base::string16::npos, std::string(), GURL(), |
| 324 metrics::OmniboxEventProto::INVALID_SPEC, false, false, true, true, false, | 324 base::string16(), metrics::OmniboxEventProto::INVALID_SPEC, false, false, |
| 325 TestSchemeClassifier()); | 325 true, true, false, TestSchemeClassifier()); |
| 326 results.AppendMatches(input, matches); | 326 results.AppendMatches(input, matches); |
| 327 results.SortAndCull( | 327 results.SortAndCull( |
| 328 input, TemplateURLServiceFactory::GetForProfile(browser()->profile())); | 328 input, TemplateURLServiceFactory::GetForProfile(browser()->profile())); |
| 329 | 329 |
| 330 // The omnibox popup should open with suggestions displayed. | 330 // The omnibox popup should open with suggestions displayed. |
| 331 omnibox_view->model()->popup_model()->OnResultChanged(); | 331 omnibox_view->model()->popup_model()->OnResultChanged(); |
| 332 EXPECT_TRUE(omnibox_view->model()->popup_model()->IsOpen()); | 332 EXPECT_TRUE(omnibox_view->model()->popup_model()->IsOpen()); |
| 333 | 333 |
| 334 // The omnibox text should be selected. | 334 // The omnibox text should be selected. |
| 335 EXPECT_TRUE(omnibox_view->IsSelectAll()); | 335 EXPECT_TRUE(omnibox_view->IsSelectAll()); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, FocusedTextInputClient) { | 386 IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, FocusedTextInputClient) { |
| 387 chrome::FocusLocationBar(browser()); | 387 chrome::FocusLocationBar(browser()); |
| 388 OmniboxView* view = NULL; | 388 OmniboxView* view = NULL; |
| 389 ASSERT_NO_FATAL_FAILURE(GetOmniboxViewForBrowser(browser(), &view)); | 389 ASSERT_NO_FATAL_FAILURE(GetOmniboxViewForBrowser(browser(), &view)); |
| 390 OmniboxViewViews* omnibox_view_views = static_cast<OmniboxViewViews*>(view); | 390 OmniboxViewViews* omnibox_view_views = static_cast<OmniboxViewViews*>(view); |
| 391 ui::InputMethod* input_method = | 391 ui::InputMethod* input_method = |
| 392 omnibox_view_views->GetWidget()->GetInputMethod(); | 392 omnibox_view_views->GetWidget()->GetInputMethod(); |
| 393 EXPECT_EQ(static_cast<ui::TextInputClient*>(omnibox_view_views), | 393 EXPECT_EQ(static_cast<ui::TextInputClient*>(omnibox_view_views), |
| 394 input_method->GetTextInputClient()); | 394 input_method->GetTextInputClient()); |
| 395 } | 395 } |
| OLD | NEW |