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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 | 337 |
338 EXPECT_FALSE(omnibox_view->model()->popup_model()->IsOpen()); | 338 EXPECT_FALSE(omnibox_view->model()->popup_model()->IsOpen()); |
339 } | 339 } |
340 | 340 |
341 IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, BackgroundIsOpaque) { | 341 IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, BackgroundIsOpaque) { |
342 // The omnibox text should be rendered on an opaque background. Otherwise, we | 342 // The omnibox text should be rendered on an opaque background. Otherwise, we |
343 // can't use subpixel rendering. | 343 // can't use subpixel rendering. |
344 OmniboxViewViews* view = BrowserView::GetBrowserViewForBrowser(browser())-> | 344 OmniboxViewViews* view = BrowserView::GetBrowserViewForBrowser(browser())-> |
345 toolbar()->location_bar()->omnibox_view(); | 345 toolbar()->location_bar()->omnibox_view(); |
346 ASSERT_TRUE(view); | 346 ASSERT_TRUE(view); |
347 EXPECT_FALSE(view->GetRenderText()->background_is_transparent()); | 347 EXPECT_TRUE(view->GetRenderText()->subpixel_rendering_enabled()); |
348 } | 348 } |
349 | 349 |
350 // Tests if executing a command hides touch editing handles. | 350 // Tests if executing a command hides touch editing handles. |
351 IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, | 351 IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, |
352 DeactivateTouchEditingOnExecuteCommand) { | 352 DeactivateTouchEditingOnExecuteCommand) { |
353 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 353 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
354 switches::kEnableTouchEditing); | 354 switches::kEnableTouchEditing); |
355 | 355 |
356 OmniboxView* view = NULL; | 356 OmniboxView* view = NULL; |
357 ASSERT_NO_FATAL_FAILURE(GetOmniboxViewForBrowser(browser(), &view)); | 357 ASSERT_NO_FATAL_FAILURE(GetOmniboxViewForBrowser(browser(), &view)); |
(...skipping 25 matching lines...) Expand all Loading... |
383 // TextInputFocusManager completes. | 383 // TextInputFocusManager completes. |
384 chrome::FocusLocationBar(browser()); | 384 chrome::FocusLocationBar(browser()); |
385 OmniboxView* view = NULL; | 385 OmniboxView* view = NULL; |
386 ASSERT_NO_FATAL_FAILURE(GetOmniboxViewForBrowser(browser(), &view)); | 386 ASSERT_NO_FATAL_FAILURE(GetOmniboxViewForBrowser(browser(), &view)); |
387 OmniboxViewViews* omnibox_view_views = static_cast<OmniboxViewViews*>(view); | 387 OmniboxViewViews* omnibox_view_views = static_cast<OmniboxViewViews*>(view); |
388 ui::TextInputFocusManager* text_input_focus_manager = | 388 ui::TextInputFocusManager* text_input_focus_manager = |
389 ui::TextInputFocusManager::GetInstance(); | 389 ui::TextInputFocusManager::GetInstance(); |
390 EXPECT_EQ(omnibox_view_views->GetTextInputClient(), | 390 EXPECT_EQ(omnibox_view_views->GetTextInputClient(), |
391 text_input_focus_manager->GetFocusedTextInputClient()); | 391 text_input_focus_manager->GetFocusedTextInputClient()); |
392 } | 392 } |
OLD | NEW |