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

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

Issue 190533006: Add support for transparent background API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Wrap Missing Permission string in #ifdef AURA Created 6 years, 7 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/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..ada4b303d6ae5a3089673314ecd9a4fbea57c60e
--- /dev/null
+++ b/chrome/test/data/extensions/platform_apps/windows_api_alpha_enabled/no_permissions/background.js
@@ -0,0 +1,36 @@
+// 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, expectedValue) {
+ 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 Aura is
+// supported.
+
+chrome.app.runtime.onLaunched.addListener(function() {
+ chrome.test.runTests([
+
+ // Window is created with alphaEnabled set to true.
+ function testAlphaEnabledNoPermInitTrue() {
+ testAlphaEnabled('testAlphaEnabledNoPermInitTrue',
+ true, true, false);
+ },
+
+ // Window is created with alphaEnabled set to false.
+ function testAlphaEnabledNoPermInitFalse() {
+ testAlphaEnabled('testAlphaEnabledNoPermInitFalse',
+ true, false, false);
+ }
+
+ ]);
+});

Powered by Google App Engine
This is Rietveld 408576698