Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc

Issue 294023002: aura: Updates the text input client when native activation changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added a TODO comment. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/chromeos/login/ui/webui_login_view.cc ('k') | ui/views/focus/focus_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/browser_commands.h" 9 #include "chrome/browser/ui/browser_commands.h"
10 #include "chrome/browser/ui/browser_window.h" 10 #include "chrome/browser/ui/browser_window.h"
11 #include "chrome/browser/ui/omnibox/location_bar.h" 11 #include "chrome/browser/ui/omnibox/location_bar.h"
12 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h" 12 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h"
13 #include "chrome/browser/ui/view_ids.h" 13 #include "chrome/browser/ui/view_ids.h"
14 #include "chrome/browser/ui/views/frame/browser_view.h" 14 #include "chrome/browser/ui/views/frame/browser_view.h"
15 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" 15 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
16 #include "chrome/test/base/in_process_browser_test.h" 16 #include "chrome/test/base/in_process_browser_test.h"
17 #include "chrome/test/base/interactive_test_utils.h" 17 #include "chrome/test/base/interactive_test_utils.h"
18 #include "grit/generated_resources.h" 18 #include "grit/generated_resources.h"
19 #include "ui/aura/test/event_generator.h" 19 #include "ui/aura/test/event_generator.h"
20 #include "ui/aura/window.h" 20 #include "ui/aura/window.h"
21 #include "ui/aura/window_tree_host.h" 21 #include "ui/aura/window_tree_host.h"
22 #include "ui/base/clipboard/clipboard.h" 22 #include "ui/base/clipboard/clipboard.h"
23 #include "ui/base/clipboard/scoped_clipboard_writer.h" 23 #include "ui/base/clipboard/scoped_clipboard_writer.h"
24 #include "ui/base/ime/text_input_focus_manager.h"
24 #include "ui/base/test/ui_controls.h" 25 #include "ui/base/test/ui_controls.h"
25 #include "ui/base/ui_base_switches.h" 26 #include "ui/base/ui_base_switches.h"
26 #include "ui/events/event_processor.h" 27 #include "ui/events/event_processor.h"
27 #include "ui/events/event_utils.h" 28 #include "ui/events/event_utils.h"
28 #include "ui/views/controls/textfield/textfield_test_api.h" 29 #include "ui/views/controls/textfield/textfield_test_api.h"
29 30
30 class OmniboxViewViewsTest : public InProcessBrowserTest { 31 class OmniboxViewViewsTest : public InProcessBrowserTest {
31 protected: 32 protected:
32 OmniboxViewViewsTest() {} 33 OmniboxViewViewsTest() {}
33 34
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 omnibox_view_views->GetBoundsInScreen().CenterPoint(); 328 omnibox_view_views->GetBoundsInScreen().CenterPoint();
328 Tap(omnibox_center, omnibox_center); 329 Tap(omnibox_center, omnibox_center);
329 EXPECT_TRUE(textfield_test_api.touch_selection_controller()); 330 EXPECT_TRUE(textfield_test_api.touch_selection_controller());
330 331
331 // Execute a command and check if it deactivate touch editing. Paste & Go is 332 // Execute a command and check if it deactivate touch editing. Paste & Go is
332 // chosen since it is specific to Omnibox and its execution wouldn't be 333 // chosen since it is specific to Omnibox and its execution wouldn't be
333 // delgated to the base Textfield class. 334 // delgated to the base Textfield class.
334 omnibox_view_views->ExecuteCommand(IDS_PASTE_AND_GO, ui::EF_NONE); 335 omnibox_view_views->ExecuteCommand(IDS_PASTE_AND_GO, ui::EF_NONE);
335 EXPECT_FALSE(textfield_test_api.touch_selection_controller()); 336 EXPECT_FALSE(textfield_test_api.touch_selection_controller());
336 } 337 }
338
339 IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, FocusedTextInputClient) {
340 base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
341 cmd_line->AppendSwitch(switches::kEnableTextInputFocusManager);
342
343 // TODO(yukishiino): The following call to FocusLocationBar is not necessary
344 // if the flag is enabled by default. Remove the call once the transition to
345 // TextInputFocusManager completes.
346 chrome::FocusLocationBar(browser());
347 OmniboxView* view = NULL;
348 ASSERT_NO_FATAL_FAILURE(GetOmniboxViewForBrowser(browser(), &view));
349 OmniboxViewViews* omnibox_view_views = static_cast<OmniboxViewViews*>(view);
350 ui::TextInputFocusManager* text_input_focus_manager =
351 ui::TextInputFocusManager::GetInstance();
352 EXPECT_EQ(omnibox_view_views->GetTextInputClient(),
353 text_input_focus_manager->GetFocusedTextInputClient());
354 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/ui/webui_login_view.cc ('k') | ui/views/focus/focus_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698