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

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

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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/api/input_ime/input_ime_api_nonchromeos.h" 5 #include "chrome/browser/extensions/api/input_ime/input_ime_api_nonchromeos.h"
6 #include "chrome/browser/extensions/extension_apitest.h" 6 #include "chrome/browser/extensions/extension_apitest.h"
7 #include "chrome/browser/ui/views/frame/browser_view.h" 7 #include "chrome/browser/ui/views/frame/browser_view.h"
8 #include "chrome/common/chrome_switches.h" 8 #include "chrome/common/chrome_switches.h"
9 #include "ui/aura/window.h" 9 #include "ui/aura/window.h"
10 #include "ui/aura/window_tree_host.h" 10 #include "ui/aura/window_tree_host.h"
(...skipping 15 matching lines...) Expand all
26 private: 26 private:
27 DISALLOW_COPY_AND_ASSIGN(InputImeApiTest); 27 DISALLOW_COPY_AND_ASSIGN(InputImeApiTest);
28 }; 28 };
29 29
30 IN_PROC_BROWSER_TEST_F(InputImeApiTest, CreateWindowTest) { 30 IN_PROC_BROWSER_TEST_F(InputImeApiTest, CreateWindowTest) {
31 // Manipulates the focused text input client because the follow cursor 31 // Manipulates the focused text input client because the follow cursor
32 // window requires the text input focus. 32 // window requires the text input focus.
33 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser()); 33 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser());
34 ui::InputMethod* input_method = 34 ui::InputMethod* input_method =
35 browser_view->GetNativeWindow()->GetHost()->GetInputMethod(); 35 browser_view->GetNativeWindow()->GetHost()->GetInputMethod();
36 scoped_ptr<ui::DummyTextInputClient> client( 36 std::unique_ptr<ui::DummyTextInputClient> client(
37 new ui::DummyTextInputClient(ui::TEXT_INPUT_TYPE_TEXT)); 37 new ui::DummyTextInputClient(ui::TEXT_INPUT_TYPE_TEXT));
38 input_method->SetFocusedTextInputClient(client.get()); 38 input_method->SetFocusedTextInputClient(client.get());
39 ExtensionFunction::ScopedUserGestureForTests scoped_user_gesture; 39 ExtensionFunction::ScopedUserGestureForTests scoped_user_gesture;
40 InputImeActivateFunction::disable_bubble_for_testing_ = true; 40 InputImeActivateFunction::disable_bubble_for_testing_ = true;
41 41
42 ASSERT_TRUE(RunExtensionTest("input_ime_nonchromeos")) << message_; 42 ASSERT_TRUE(RunExtensionTest("input_ime_nonchromeos")) << message_;
43 43
44 // Test the input.ime.sendKeyEvents API. 44 // Test the input.ime.sendKeyEvents API.
45 ASSERT_EQ(client->insert_char_count(), 1); 45 ASSERT_EQ(client->insert_char_count(), 1);
46 ASSERT_EQ(client->last_insert_char(), L'a'); 46 ASSERT_EQ(client->last_insert_char(), L'a');
47 47
48 input_method->DetachTextInputClient(client.get()); 48 input_method->DetachTextInputClient(client.get());
49 } 49 }
50 50
51 } // namespace extensions 51 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/ime/ime_window_view.h ('k') | chrome/browser/ui/views/infobars/alternate_nav_infobar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698