| Index: chrome/test/data/extensions/platform_apps/windows_api_alpha_enabled/has_permissions_no_alpha/background.js
|
| diff --git a/chrome/test/data/extensions/platform_apps/windows_api_alpha_enabled/has_permissions_no_alpha/background.js b/chrome/test/data/extensions/platform_apps/windows_api_alpha_enabled/has_permissions_no_alpha/background.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..79ead26cbd44b49289c726b5a8c18d8b0e5defcb
|
| --- /dev/null
|
| +++ b/chrome/test/data/extensions/platform_apps/windows_api_alpha_enabled/has_permissions_no_alpha/background.js
|
| @@ -0,0 +1,43 @@
|
| +// 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 testAlphaEnabled(testId, setOption, setValue, expectedValue) {
|
| + console.log(testId);
|
| + var createOptions = { id: testId };
|
| + if (setOption)
|
| + createOptions.alphaEnabled = setValue;
|
| +
|
| + chrome.app.window.create('index.html',
|
| + createOptions,
|
| + chrome.test.callbackPass(function(win) {
|
| + chrome.test.assertEq(expectedValue, win.alphaEnabled());
|
| + }));
|
| +}
|
| +
|
| +// All these tests are run with app.window.alpha permission
|
| +// set and on a system without alpha (transparency) support.
|
| +
|
| +chrome.app.runtime.onLaunched.addListener(function() {
|
| + chrome.test.runTests([
|
| +
|
| + // Window is created with alphaEnabled set to true.
|
| + function testAlphaEnabledPermNoTransInitTrue() {
|
| + testAlphaEnabled('testAlphaEnabledPermNoTransInitTrue',
|
| + true, true, false);
|
| + },
|
| +
|
| + // Window is created with alphaEnabled set to false.
|
| + function testAlphaEnabledPermNoTransInitFalse() {
|
| + testAlphaEnabled('testAlphaEnabledPermNoTransInitFalse',
|
| + true, false, false);
|
| + },
|
| +
|
| + // Window is created with alphaEnabled not explicitly set.
|
| + function testAlphaEnabledPermNoTransNoInit() {
|
| + testAlphaEnabled('testAlphaEnabledPermNoTransNoInit',
|
| + false, false, false);
|
| + }
|
| +
|
| + ]);
|
| +});
|
|
|