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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 BrowserWindowTesting* window = browser()->window()->GetBrowserWindowTesting(); | 288 BrowserWindowTesting* window = browser()->window()->GetBrowserWindowTesting(); |
289 ASSERT_TRUE(window); | 289 ASSERT_TRUE(window); |
290 OmniboxViewViews* view = window->GetLocationBarView()->omnibox_view(); | 290 OmniboxViewViews* view = window->GetLocationBarView()->omnibox_view(); |
291 ASSERT_TRUE(view); | 291 ASSERT_TRUE(view); |
292 EXPECT_FALSE(view->GetRenderText()->background_is_transparent()); | 292 EXPECT_FALSE(view->GetRenderText()->background_is_transparent()); |
293 } | 293 } |
294 | 294 |
295 // Tests if executing a command hides touch editing handles. | 295 // Tests if executing a command hides touch editing handles. |
296 IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, | 296 IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, |
297 DeactivateTouchEditingOnExecuteCommand) { | 297 DeactivateTouchEditingOnExecuteCommand) { |
298 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kEnableTouchEditing); | 298 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 299 switches::kEnableTouchEditing); |
299 | 300 |
300 OmniboxView* view = NULL; | 301 OmniboxView* view = NULL; |
301 ASSERT_NO_FATAL_FAILURE(GetOmniboxViewForBrowser(browser(), &view)); | 302 ASSERT_NO_FATAL_FAILURE(GetOmniboxViewForBrowser(browser(), &view)); |
302 OmniboxViewViews* omnibox_view_views = static_cast<OmniboxViewViews*>(view); | 303 OmniboxViewViews* omnibox_view_views = static_cast<OmniboxViewViews*>(view); |
303 views::TextfieldTestApi textfield_test_api(omnibox_view_views); | 304 views::TextfieldTestApi textfield_test_api(omnibox_view_views); |
304 | 305 |
305 // Put a URL on the clipboard. It is written to the clipboard upon destruction | 306 // Put a URL on the clipboard. It is written to the clipboard upon destruction |
306 // of the writer. | 307 // of the writer. |
307 { | 308 { |
308 ui::ScopedClipboardWriter clipboard_writer( | 309 ui::ScopedClipboardWriter clipboard_writer( |
(...skipping 23 matching lines...) Expand all Loading... |
332 // TextInputFocusManager completes. | 333 // TextInputFocusManager completes. |
333 chrome::FocusLocationBar(browser()); | 334 chrome::FocusLocationBar(browser()); |
334 OmniboxView* view = NULL; | 335 OmniboxView* view = NULL; |
335 ASSERT_NO_FATAL_FAILURE(GetOmniboxViewForBrowser(browser(), &view)); | 336 ASSERT_NO_FATAL_FAILURE(GetOmniboxViewForBrowser(browser(), &view)); |
336 OmniboxViewViews* omnibox_view_views = static_cast<OmniboxViewViews*>(view); | 337 OmniboxViewViews* omnibox_view_views = static_cast<OmniboxViewViews*>(view); |
337 ui::TextInputFocusManager* text_input_focus_manager = | 338 ui::TextInputFocusManager* text_input_focus_manager = |
338 ui::TextInputFocusManager::GetInstance(); | 339 ui::TextInputFocusManager::GetInstance(); |
339 EXPECT_EQ(omnibox_view_views->GetTextInputClient(), | 340 EXPECT_EQ(omnibox_view_views->GetTextInputClient(), |
340 text_input_focus_manager->GetFocusedTextInputClient()); | 341 text_input_focus_manager->GetFocusedTextInputClient()); |
341 } | 342 } |
OLD | NEW |