| Index: chrome/test/data/extensions/platform_apps/windows_api_ime/no_permissions_platform_app/background.js
|
| diff --git a/chrome/test/data/extensions/platform_apps/windows_api_ime/no_permissions_platform_app/background.js b/chrome/test/data/extensions/platform_apps/windows_api_ime/no_permissions_platform_app/background.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..0f1dcb917093e6523fb167cb9e55a61d079a34de
|
| --- /dev/null
|
| +++ b/chrome/test/data/extensions/platform_apps/windows_api_ime/no_permissions_platform_app/background.js
|
| @@ -0,0 +1,45 @@
|
| +// 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.
|
| +
|
| +var error = "The ime option is not supported for platform app.";
|
| +
|
| +function testImeEnabled(testId, setOption, opt_setValue, opt_expectedValue) {
|
| + var createOptions = { frame: 'none' };
|
| + if (setOption) {
|
| + createOptions.ime = opt_setValue;
|
| + chrome.app.window.create('index.html',
|
| + createOptions,
|
| + chrome.test.callbackFail(error));
|
| + } else {
|
| + chrome.app.window.create('index.html',
|
| + createOptions,
|
| + chrome.test.callbackPass(function(win){
|
| + chrome.test.assertEq(opt_expectedValue, win.isImeWindow());
|
| + }));
|
| + }
|
| +}
|
| +
|
| +// All these tests are run with app.window.ime permission set and on a system
|
| +// with ime window support.
|
| +chrome.app.runtime.onLaunched.addListener(function() {
|
| + chrome.test.runTests([
|
| + // Window is created with ime set to true.
|
| + function testImeEnabledPermTransInitTrue() {
|
| + testImeEnabled('testImeEnabledPermTransInitTrue',
|
| + true, true);
|
| + },
|
| +
|
| + // Window is created with ime set to false.
|
| + function testImeEnabledPermTransInitFalse() {
|
| + testImeEnabled('testImeEnabledPermTransInitFalse',
|
| + true, false);
|
| + },
|
| +
|
| + // Window is created with ime not explicitly set.
|
| + function testImeEnabledPermTransNoInit() {
|
| + testImeEnabled('testImeEnabledPermTransNoInit',
|
| + false, false, false);
|
| + }
|
| + ]);
|
| +});
|
|
|