Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / chrome / test / data / extensions / platform_apps / windows_api_alpha_enabled / in_stable / background.js
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 var error = "The alphaEnabled option requires dev channel or newer.";
6
7 function testAlphaEnabled(testId, setValue) {
8   var createOptions = { frame: 'none' };
9   createOptions.alphaEnabled = setValue;
10
11   chrome.app.window.create('index.html',
12                            createOptions,
13                            chrome.test.callbackFail(error));
14 }
15
16 // All these tests are run in Stable channel with app.window.alpha
17 // permission set.
18
19 chrome.app.runtime.onLaunched.addListener(function() {
20   chrome.test.runTests([
21
22     // Window is created with alphaEnabled set to true.
23     function testAlphaEnabledStableInitTrue() {
24       testAlphaEnabled('testAlphaEnabledStableInitTrue', true);
25     },
26
27     // Window is created with alphaEnabled set to false.
28     function testAlphaEnabledStableInitFalse() {
29       testAlphaEnabled('testAlphaEnabledStableInitFalse', false);
30     },
31
32   ]);
33 });