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

Unified Diff: chrome/test/data/extensions/api_test/input_method/ime_menu/background.js

Issue 1552743003: Add chrome.inputMethodPrivate.onImeMenuActivationChanged API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make IME menu test as a separate browser test. Created 4 years, 11 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/extensions/api_test/input_method/ime_menu/background.js
diff --git a/chrome/test/data/extensions/api_test/input_method/ime_menu/background.js b/chrome/test/data/extensions/api_test/input_method/ime_menu/background.js
new file mode 100644
index 0000000000000000000000000000000000000000..e0670695416ed54f3bcc66088ec158daf12a8fc7
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/input_method/ime_menu/background.js
@@ -0,0 +1,28 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+function imeMenuConfigTest() {
+ chrome.inputMethodPrivate.getInputMethodConfig(function(config) {
+ chrome.test.assertTrue(config["isImeMenuActivated"]);
+ chrome.test.succeed();
+ });
+}
+
+function imeMenuActivationChangedTest() {
+ chrome.inputMethodPrivate.onImeMenuActivationChanged.addListener(
+ function(isActive) {
+ chrome.test.assertFalse(isActive);
+ // Wait for the 'event_ready' message in
+ // ExtensionInputMethodApiTest.ImeMenuActivation.
+ chrome.test.sendMessage('event_ready');
+ });
+ // We just add the listener without receiving any event at first time.
+ // The test continues in input_method_apitest_chromeos.cc to trigger
+ // the event, and succeeds after getting the 'event_ready' message.
+ chrome.test.succeed();
+}
+
+chrome.test.sendMessage('config_ready');
+chrome.test.runTests(
Devlin 2016/01/25 20:35:36 This style of test would be more suited to just th
Azure Wei 2016/01/27 05:06:26 Done.
+ [imeMenuConfigTest, imeMenuActivationChangedTest]);

Powered by Google App Engine
This is Rietveld 408576698