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

Side by Side Diff: chrome/browser/chromeos/extensions/input_method_apitest_chromeos.cc

Issue 309623005: Remove the flag g_use_wrapped_extension_keyboard_layouts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 const std::string& content = *content::Details<std::string>(details).ptr(); 51 const std::string& content = *content::Details<std::string>(details).ptr();
52 if (content == kBackgroundReady) { 52 if (content == kBackgroundReady) {
53 // Initializes IMF for testing when receives ready message from 53 // Initializes IMF for testing when receives ready message from
54 // background. 54 // background.
55 chromeos::input_method::InputMethodManager* manager = 55 chromeos::input_method::InputMethodManager* manager =
56 chromeos::input_method::InputMethodManager::Get(); 56 chromeos::input_method::InputMethodManager::Get();
57 manager->GetInputMethodUtil()->InitXkbInputMethodsForTesting(); 57 manager->GetInputMethodUtil()->InitXkbInputMethodsForTesting();
58 58
59 std::vector<std::string> keyboard_layouts; 59 std::vector<std::string> keyboard_layouts;
60 keyboard_layouts.push_back( 60 keyboard_layouts.push_back(
61 chromeos::extension_ime_util::GetInputMethodIDByKeyboardLayout( 61 chromeos::extension_ime_util::GetInputMethodIDByEngineID(
62 kInitialInputMethodOnLoginScreen)); 62 kInitialInputMethodOnLoginScreen));
63 manager->EnableLoginLayouts(kLoginScreenUILanguage, keyboard_layouts); 63 manager->EnableLoginLayouts(kLoginScreenUILanguage, keyboard_layouts);
64 return; 64 return;
65 } 65 }
66 66
67 const std::string expected_message = 67 const std::string expected_message =
68 base::StringPrintf("%s:%s", kSetInputMethodMessage, kNewInputMethod); 68 base::StringPrintf("%s:%s", kSetInputMethodMessage, kNewInputMethod);
69 if (content == expected_message) { 69 if (content == expected_message) {
70 chromeos::input_method::InputMethodManager::Get()->ChangeInputMethod( 70 chromeos::input_method::InputMethodManager::Get()->ChangeInputMethod(
71 chromeos::extension_ime_util::GetInputMethodIDByKeyboardLayout( 71 chromeos::extension_ime_util::GetInputMethodIDByEngineID(
72 base::StringPrintf("xkb:%s", kNewInputMethod))); 72 base::StringPrintf("xkb:%s", kNewInputMethod)));
73 73
74 scoped_refptr<extensions::TestSendMessageFunction> function = 74 scoped_refptr<extensions::TestSendMessageFunction> function =
75 content::Source<extensions::TestSendMessageFunction>( 75 content::Source<extensions::TestSendMessageFunction>(
76 source).ptr(); 76 source).ptr();
77 EXPECT_GT(count_--, 0); 77 EXPECT_GT(count_--, 0);
78 function->Reply(kSetInputMethodDone); 78 function->Reply(kSetInputMethodDone);
79 } 79 }
80 } 80 }
81 81
(...skipping 13 matching lines...) Expand all
95 }; 95 };
96 96
97 } // namespace 97 } // namespace
98 98
99 IN_PROC_BROWSER_TEST_F(ExtensionInputMethodApiTest, Basic) { 99 IN_PROC_BROWSER_TEST_F(ExtensionInputMethodApiTest, Basic) {
100 // Two test, two calls. See JS code for more info. 100 // Two test, two calls. See JS code for more info.
101 SetInputMethodListener listener(2); 101 SetInputMethodListener listener(2);
102 102
103 ASSERT_TRUE(RunExtensionTest("input_method")) << message_; 103 ASSERT_TRUE(RunExtensionTest("input_method")) << message_;
104 } 104 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698