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

Unified Diff: chrome/test/data/extensions/platform_apps/windows_api_alpha_enabled/has_permissions_has_alpha/background.js

Issue 190533006: Add support for transparent background API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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_alpha_enabled/has_permissions_has_alpha/background.js
diff --git a/chrome/test/data/extensions/platform_apps/windows_api_alpha_enabled/has_permissions_has_alpha/background.js b/chrome/test/data/extensions/platform_apps/windows_api_alpha_enabled/has_permissions_has_alpha/background.js
new file mode 100644
index 0000000000000000000000000000000000000000..5e96e0a4a51692f8bd2747e7bb588b0d50c708ed
--- /dev/null
+++ b/chrome/test/data/extensions/platform_apps/windows_api_alpha_enabled/has_permissions_has_alpha/background.js
@@ -0,0 +1,42 @@
+// 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) {
+ var createOptions = { };
+ 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 with alpha (transparency) support.
+
+chrome.app.runtime.onLaunched.addListener(function() {
+ chrome.test.runTests([
+
+ // Window is created with alphaEnabled set to true.
+ function testAlphaEnabledPermTransInitTrue() {
+ testAlphaEnabled('testAlphaEnabledPermTransInitTrue',
+ true, true, true);
+ },
+
+ // Window is created with alphaEnabled set to false.
+ function testAlphaEnabledPermTransInitFalse() {
+ testAlphaEnabled('testAlphaEnabledPermTransInitFalse',
+ true, false, false);
+ },
+
+ // Window is created with alphaEnabled not explicitly set.
+ function testAlphaEnabledPermTransNoInit() {
+ testAlphaEnabled('testAlphaEnabledPermTransNoInit',
+ false, false, false);
+ }
+
+ ]);
+});

Powered by Google App Engine
This is Rietveld 408576698