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

Unified Diff: chrome/test/data/webui/settings/fake_language_settings_private.js

Issue 2255043002: Remove input methods when removing languages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/webui/settings/fake_language_settings_private.js
diff --git a/chrome/test/data/webui/settings/fake_language_settings_private.js b/chrome/test/data/webui/settings/fake_language_settings_private.js
index 4a4c0aab3db5c9ba27f8e9b2e8b7b62319ee5e05..5925e4ba739b5aefe8a713b53c7cb7ec846dd793 100644
--- a/chrome/test/data/webui/settings/fake_language_settings_private.js
+++ b/chrome/test/data/webui/settings/fake_language_settings_private.js
@@ -85,6 +85,16 @@ cr.define('settings', function() {
displayName: 'US Dvorak keyboard',
languageCodes: ['en', 'en-US'],
enabled: true,
+ }, {
+ id: '_comp_ime_abcdefghijklmnopqrstuvwxyzabcdefxkb:sw:sw',
+ displayName: 'Swahili keyboard',
+ languageCodes: ['sw', 'tk'],
+ enabled: false,
+ }, {
+ id: '_comp_ime_abcdefghijklmnopqrstuvwxyzabcdefxkb:us:sw',
+ displayName: 'US Swahili keyboard',
+ languageCodes: ['en', 'en-US', 'sw'],
+ enabled: false,
}];
}
@@ -179,7 +189,18 @@ cr.define('settings', function() {
* methods, enabling the input method for the current user. Chrome OS only.
* @param {string} inputMethodId
*/
- addInputMethod: wrapAssertNotReached('addInputMethod'),
+ addInputMethod: function(inputMethodId) {
+ assert(cr.isChromeOS);
+ var inputMethod = this.componentExtensionImes.find(function(ime) {
+ return ime.id == inputMethodId;
+ });
+ assertTrue(!!inputMethod);
+ inputMethod.enabled = true;
+ var prefPath = 'prefs.settings.language.preload_engines.value';
+ var enabledInputMethods = this.settingsPrefs_.get(prefPath).split(',');
+ enabledInputMethods.push(inputMethodId);
+ this.settingsPrefs_.set(prefPath, enabledInputMethods.join(','))
+ },
/**
* Removes the input method from the current user's list of enabled input
« no previous file with comments | « chrome/browser/resources/settings/languages_page/languages.js ('k') | chrome/test/data/webui/settings/languages_page_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698