Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 var kNewInputMethodTemplate = '_comp_ime_{EXT_ID}xkb:fr::fra'; | 5 var kNewInputMethodTemplate = '_comp_ime_{EXT_ID}xkb:fr::fra'; |
| 6 var kInitialInputMethodRegex = /_comp_ime_([a-z]{32})xkb:us::eng/; | 6 var kInitialInputMethodRegex = /_comp_ime_([a-z]{32})xkb:us::eng/; |
| 7 var kInvalidInputMethod = 'xx::xxx'; | 7 var kInvalidInputMethod = 'xx::xxx'; |
| 8 | 8 |
| 9 var testParams = { | 9 var testParams = { |
| 10 initialInputMethod: '', | 10 initialInputMethod: '', |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 185 chrome.test.assertTrue(removed.length === 0); | 185 chrome.test.assertTrue(removed.length === 0); |
| 186 chrome.test.assertEq(added[0], wordToAdd); | 186 chrome.test.assertEq(added[0], wordToAdd); |
| 187 chrome.test.succeed(); | 187 chrome.test.succeed(); |
| 188 }); | 188 }); |
| 189 }) | 189 }) |
| 190 .then(function() { | 190 .then(function() { |
| 191 return getAddPromise(wordToAdd); | 191 return getAddPromise(wordToAdd); |
| 192 }); | 192 }); |
| 193 } | 193 } |
| 194 | 194 |
| 195 function imeMenuConfigTest() { | |
| 196 chrome.inputMethodPrivate.getInputMethodConfig(function(config) { | |
| 197 chrome.test.assertTrue(config["isImeMenuActivated"]); | |
| 198 chrome.test.succeed(); | |
| 199 }); | |
| 200 } | |
| 201 | |
| 202 function imeMenuActivationChangedTest() { | |
|
Devlin
2016/01/21 19:36:02
Thinking about this more, let's have this one be a
Azure Wei
2016/01/23 02:40:39
Done. The imeMenuConfigTest() and imeMenuActivatio
| |
| 203 chrome.inputMethodPrivate.onImeMenuActivationChanged.addListener( | |
| 204 function(activation) { | |
|
Devlin
2016/01/21 19:30:25
nit: as elsewhere, prefer a variable name of "isAc
Azure Wei
2016/01/23 02:40:39
Done.
| |
| 205 chrome.test.assertTrue(!activation); | |
|
Devlin
2016/01/21 19:30:25
prefer assertFalse
Azure Wei
2016/01/23 02:40:39
Done.
| |
| 206 chrome.test.sendMessage('ime_menu_ready'); | |
| 207 chrome.test.succeed(); | |
|
stevenjb
2016/01/21 19:16:16
Remove this extra test.succeed() call and add a co
Azure Wei
2016/01/23 02:40:39
Done.
| |
| 208 }); | |
| 209 // We just add the listener without receiving any event at first. | |
|
Devlin
2016/01/21 19:30:25
Add that the test is continued in the C++; otherwi
Azure Wei
2016/01/23 02:40:39
Done.
| |
| 210 chrome.test.succeed(); | |
| 211 } | |
| 212 | |
| 195 chrome.test.sendMessage('ready'); | 213 chrome.test.sendMessage('ready'); |
| 196 chrome.test.runTests( | 214 chrome.test.runTests( |
| 197 [initTests, setTest, getTest, observeTest, setInvalidTest, getListTest, | 215 [initTests, setTest, getTest, observeTest, setInvalidTest, getListTest, |
| 198 loadDictionaryAsyncTest, fetchDictionaryTest, addWordToDictionaryTest, | 216 loadDictionaryAsyncTest, fetchDictionaryTest, addWordToDictionaryTest, |
| 199 dictionaryChangedTest]); | 217 dictionaryChangedTest, imeMenuConfigTest, imeMenuActivationChangedTest]); |
| OLD | NEW |