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

Side by Side Diff: chrome/browser/chromeos/input_method/input_method_engine_browsertests.cc

Issue 1870793002: Convert //chrome/browser/chromeos 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 InputMethodEngineBrowserTest, 150 InputMethodEngineBrowserTest,
151 ::testing::Values(kTestTypeComponent)); 151 ::testing::Values(kTestTypeComponent));
152 152
153 IN_PROC_BROWSER_TEST_P(InputMethodEngineBrowserTest, 153 IN_PROC_BROWSER_TEST_P(InputMethodEngineBrowserTest,
154 BasicScenarioTest) { 154 BasicScenarioTest) {
155 LoadTestInputMethod(); 155 LoadTestInputMethod();
156 156
157 InputMethodManager::Get()->GetActiveIMEState()->ChangeInputMethod( 157 InputMethodManager::Get()->GetActiveIMEState()->ChangeInputMethod(
158 kIdentityIMEID, false /* show_message */); 158 kIdentityIMEID, false /* show_message */);
159 159
160 scoped_ptr<MockIMEInputContextHandler> mock_input_context( 160 std::unique_ptr<MockIMEInputContextHandler> mock_input_context(
161 new MockIMEInputContextHandler()); 161 new MockIMEInputContextHandler());
162 scoped_ptr<MockIMECandidateWindowHandler> mock_candidate_window( 162 std::unique_ptr<MockIMECandidateWindowHandler> mock_candidate_window(
163 new MockIMECandidateWindowHandler()); 163 new MockIMECandidateWindowHandler());
164 164
165 ui::IMEBridge::Get()->SetInputContextHandler(mock_input_context.get()); 165 ui::IMEBridge::Get()->SetInputContextHandler(mock_input_context.get());
166 ui::IMEBridge::Get()->SetCandidateWindowHandler(mock_candidate_window.get()); 166 ui::IMEBridge::Get()->SetCandidateWindowHandler(mock_candidate_window.get());
167 167
168 ui::IMEEngineHandlerInterface* engine_handler = 168 ui::IMEEngineHandlerInterface* engine_handler =
169 ui::IMEBridge::Get()->GetCurrentEngineHandler(); 169 ui::IMEBridge::Get()->GetCurrentEngineHandler();
170 ASSERT_TRUE(engine_handler); 170 ASSERT_TRUE(engine_handler);
171 171
172 // onActivate event should be fired if Enable function is called. 172 // onActivate event should be fired if Enable function is called.
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 ui::IMEBridge::Get()->SetCandidateWindowHandler(NULL); 233 ui::IMEBridge::Get()->SetCandidateWindowHandler(NULL);
234 } 234 }
235 235
236 IN_PROC_BROWSER_TEST_P(InputMethodEngineBrowserTest, 236 IN_PROC_BROWSER_TEST_P(InputMethodEngineBrowserTest,
237 APIArgumentTest) { 237 APIArgumentTest) {
238 LoadTestInputMethod(); 238 LoadTestInputMethod();
239 239
240 InputMethodManager::Get()->GetActiveIMEState()->ChangeInputMethod( 240 InputMethodManager::Get()->GetActiveIMEState()->ChangeInputMethod(
241 kAPIArgumentIMEID, false /* show_message */); 241 kAPIArgumentIMEID, false /* show_message */);
242 242
243 scoped_ptr<MockIMEInputContextHandler> mock_input_context( 243 std::unique_ptr<MockIMEInputContextHandler> mock_input_context(
244 new MockIMEInputContextHandler()); 244 new MockIMEInputContextHandler());
245 scoped_ptr<MockIMECandidateWindowHandler> mock_candidate_window( 245 std::unique_ptr<MockIMECandidateWindowHandler> mock_candidate_window(
246 new MockIMECandidateWindowHandler()); 246 new MockIMECandidateWindowHandler());
247 247
248 ui::IMEBridge::Get()->SetInputContextHandler(mock_input_context.get()); 248 ui::IMEBridge::Get()->SetInputContextHandler(mock_input_context.get());
249 ui::IMEBridge::Get()->SetCandidateWindowHandler(mock_candidate_window.get()); 249 ui::IMEBridge::Get()->SetCandidateWindowHandler(mock_candidate_window.get());
250 250
251 ui::IMEEngineHandlerInterface* engine_handler = 251 ui::IMEEngineHandlerInterface* engine_handler =
252 ui::IMEBridge::Get()->GetCurrentEngineHandler(); 252 ui::IMEBridge::Get()->GetCurrentEngineHandler();
253 ASSERT_TRUE(engine_handler); 253 ASSERT_TRUE(engine_handler);
254 254
255 extensions::ExtensionHost* host = 255 extensions::ExtensionHost* host =
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 EXPECT_EQ("", mock_input_context->last_commit_text()); 1041 EXPECT_EQ("", mock_input_context->last_commit_text());
1042 } 1042 }
1043 1043
1044 ui::IMEBridge::Get()->SetInputContextHandler(NULL); 1044 ui::IMEBridge::Get()->SetInputContextHandler(NULL);
1045 ui::IMEBridge::Get()->SetCandidateWindowHandler(NULL); 1045 ui::IMEBridge::Get()->SetCandidateWindowHandler(NULL);
1046 } 1046 }
1047 1047
1048 } // namespace 1048 } // namespace
1049 } // namespace input_method 1049 } // namespace input_method
1050 } // namespace chromeos 1050 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698