| 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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 | 338 |
| 339 EXPECT_FALSE(omnibox_view->model()->popup_model()->IsOpen()); | 339 EXPECT_FALSE(omnibox_view->model()->popup_model()->IsOpen()); |
| 340 } | 340 } |
| 341 | 341 |
| 342 IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, BackgroundIsOpaque) { | 342 IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, BackgroundIsOpaque) { |
| 343 // The omnibox text should be rendered on an opaque background. Otherwise, we | 343 // The omnibox text should be rendered on an opaque background. Otherwise, we |
| 344 // can't use subpixel rendering. | 344 // can't use subpixel rendering. |
| 345 OmniboxViewViews* view = BrowserView::GetBrowserViewForBrowser(browser())-> | 345 OmniboxViewViews* view = BrowserView::GetBrowserViewForBrowser(browser())-> |
| 346 toolbar()->location_bar()->omnibox_view(); | 346 toolbar()->location_bar()->omnibox_view(); |
| 347 ASSERT_TRUE(view); | 347 ASSERT_TRUE(view); |
| 348 EXPECT_FALSE(view->GetRenderText()->background_is_transparent()); | 348 EXPECT_TRUE(view->GetRenderText()->subpixel_rendering_enabled()); |
| 349 } | 349 } |
| 350 | 350 |
| 351 // Tests if executing a command hides touch editing handles. | 351 // Tests if executing a command hides touch editing handles. |
| 352 IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, | 352 IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, |
| 353 DeactivateTouchEditingOnExecuteCommand) { | 353 DeactivateTouchEditingOnExecuteCommand) { |
| 354 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 354 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 355 switches::kEnableTouchEditing); | 355 switches::kEnableTouchEditing); |
| 356 | 356 |
| 357 OmniboxView* view = NULL; | 357 OmniboxView* view = NULL; |
| 358 ASSERT_NO_FATAL_FAILURE(GetOmniboxViewForBrowser(browser(), &view)); | 358 ASSERT_NO_FATAL_FAILURE(GetOmniboxViewForBrowser(browser(), &view)); |
| (...skipping 25 matching lines...) Expand all 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 |