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

Side by Side Diff: chrome/browser/ui/views/ime/input_ime_apitest_nonchromeos.cc

Issue 1771173002: Implement input.ime.sendKeyEvents API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test failure. Created 4 years, 9 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/extensions/extension_apitest.h" 5 #include "chrome/browser/extensions/extension_apitest.h"
6 #include "chrome/browser/ui/views/frame/browser_view.h" 6 #include "chrome/browser/ui/views/frame/browser_view.h"
7 #include "chrome/common/chrome_switches.h" 7 #include "chrome/common/chrome_switches.h"
8 #include "ui/aura/window.h" 8 #include "ui/aura/window.h"
9 #include "ui/aura/window_tree_host.h" 9 #include "ui/aura/window_tree_host.h"
10 #include "ui/base/ime/dummy_text_input_client.h" 10 #include "ui/base/ime/dummy_text_input_client.h"
(...skipping 20 matching lines...) Expand all
31 // window requires the text input focus. 31 // window requires the text input focus.
32 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser()); 32 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser());
33 ui::InputMethod* input_method = 33 ui::InputMethod* input_method =
34 browser_view->GetNativeWindow()->GetHost()->GetInputMethod(); 34 browser_view->GetNativeWindow()->GetHost()->GetInputMethod();
35 scoped_ptr<ui::DummyTextInputClient> client( 35 scoped_ptr<ui::DummyTextInputClient> client(
36 new ui::DummyTextInputClient(ui::TEXT_INPUT_TYPE_TEXT)); 36 new ui::DummyTextInputClient(ui::TEXT_INPUT_TYPE_TEXT));
37 input_method->SetFocusedTextInputClient(client.get()); 37 input_method->SetFocusedTextInputClient(client.get());
38 38
39 ASSERT_TRUE(RunExtensionTest("input_ime_nonchromeos")) << message_; 39 ASSERT_TRUE(RunExtensionTest("input_ime_nonchromeos")) << message_;
40 40
41 // Test the input.ime.sendKeyEvents API.
42 ASSERT_EQ(client->insert_char_count(), 1);
43 ASSERT_EQ(client->last_insert_char(), L'a');
44
41 input_method->DetachTextInputClient(client.get()); 45 input_method->DetachTextInputClient(client.get());
42 } 46 }
43 47
44 } // namespace extensions 48 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/ui/input_method/input_method_engine_base.cc ('k') | chrome/common/extensions/api/input_ime.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698