| Index: chrome/test/data/extensions/platform_apps/windows_api_alpha_enabled/no_permissions/background.js
|
| diff --git a/chrome/test/data/extensions/platform_apps/windows_api_alpha_enabled/no_permissions/background.js b/chrome/test/data/extensions/platform_apps/windows_api_alpha_enabled/no_permissions/background.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..310ca71477ef91fee5a7c6011cb922d96ecd83d4
|
| --- /dev/null
|
| +++ b/chrome/test/data/extensions/platform_apps/windows_api_alpha_enabled/no_permissions/background.js
|
| @@ -0,0 +1,35 @@
|
| +// 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 alphaEnabled option requires app.window.alpha permission.";
|
| +
|
| +function testAlphaEnabled(testId, setValue) {
|
| + var createOptions = { id: testId };
|
| + createOptions.alphaEnabled = setValue;
|
| +
|
| + chrome.app.window.create('index.html',
|
| + createOptions,
|
| + chrome.test.callbackFail(error));
|
| +}
|
| +
|
| +// All these tests are run without app.window.alpha permission
|
| +// set. Test results are the same regardless of whether or not
|
| +// alpha (transparency) is supported by the platform.
|
| +
|
| +chrome.app.runtime.onLaunched.addListener(function() {
|
| + chrome.test.runTests([
|
| +
|
| + // Window is created with alphaEnabled set to true.
|
| + function testAlphaEnabledNoPermInitTrue() {
|
| + testAlphaEnabled('testAlphaEnabledNoPermInitTrue', true);
|
| + },
|
| +
|
| + // Window is created with alphaEnabled set to false.
|
| + function testAlphaEnabledNoPermInitFalse() {
|
| + testAlphaEnabled('testAlphaEnabledNoPermInitFalse', false);
|
| + },
|
| +
|
| + ]);
|
| +});
|
| +
|
|
|