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

Unified Diff: chrome/test/data/extensions/platform_apps/windows_api_ime/has_permissions_whitelisted/background.js

Issue 503383002: Allow component IME extension use app.window and add 'ime' window type for app window (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more tests Created 6 years, 3 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/platform_apps/windows_api_ime/has_permissions_whitelisted/background.js
diff --git a/chrome/test/data/extensions/platform_apps/windows_api_ime/has_permissions_whitelisted/background.js b/chrome/test/data/extensions/platform_apps/windows_api_ime/has_permissions_whitelisted/background.js
new file mode 100644
index 0000000000000000000000000000000000000000..8442557464906aaf4937910020a818118db3e4f3
--- /dev/null
+++ b/chrome/test/data/extensions/platform_apps/windows_api_ime/has_permissions_whitelisted/background.js
@@ -0,0 +1,39 @@
+// Copyright 2014 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 testImeEnabled(testId, setOption, setValue, expectedValue) {
+ var createOptions = { frame: 'none' };
+ if (setOption)
+ createOptions.ime = setValue;
+
+ chrome.app.window.create('index.html',
+ createOptions,
+ chrome.test.callbackPass(function(win) {
+ chrome.test.assertEq(expectedValue, win.isImeWindow());
+ }));
+}
+
+// All these tests are run with app.window.ime permission set and on a system
+// with ime window support.
+chrome.test.runTests([
+
+ // Window is created with ime set to true.
+ function testImeEnabledPermTransInitTrue() {
+ testImeEnabled('testImeEnabledPermTransInitTrue',
+ true, true, true);
+ },
+
+ // Window is created with ime set to false.
+ function testImeEnabledPermTransInitFalse() {
+ testImeEnabled('testImeEnabledPermTransInitFalse',
+ true, false, false);
+ },
+
+ // Window is created with ime not explicitly set.
+ function testImeEnabledPermTransNoInit() {
+ testImeEnabled('testImeEnabledPermTransNoInit',
+ false, false, false);
+ }
+
+]);

Powered by Google App Engine
This is Rietveld 408576698