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

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

Issue 26427002: Add always-on-top property to app windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed potentially flaky test Created 7 years, 2 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_always_on_top/background.js
diff --git a/chrome/test/data/extensions/platform_apps/windows_api_always_on_top/background.js b/chrome/test/data/extensions/platform_apps/windows_api_always_on_top/background.js
new file mode 100644
index 0000000000000000000000000000000000000000..7345da2d4d586dc6c292425a051b659991bbfab2
--- /dev/null
+++ b/chrome/test/data/extensions/platform_apps/windows_api_always_on_top/background.js
@@ -0,0 +1,40 @@
+// Copyright 2013 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 callbackPass = chrome.test.callbackPass;
+
+function testAlwaysOnTop(testId, initValue, setOption) {
+ var options = { id: testId };
+ if (setOption)
+ options.alwaysOnTop = initValue;
+
+ chrome.app.window.create('index.html',
+ options,
+ callbackPass(function(win) {
+ // Check that isAlwaysOnTop() returns the initial value.
+ chrome.test.assertEq(initValue, win.isAlwaysOnTop());
+ win.contentWindow.close();
+ }));
+}
+
+chrome.app.runtime.onLaunched.addListener(function() {
+ chrome.test.runTests([
+
+ // Window is created with always on top enabled.
+ function testAlwaysOnTopInitTrue() {
+ testAlwaysOnTop('testAlwaysOnTopInitTrue', true, true);
+ },
+
+ // Window is created with always on top explicitly disabled.
+ function testAlwaysOnTopInitFalse() {
+ testAlwaysOnTop('testAlwaysOnTopInitFalse', false, true);
+ },
+
+ // Window is created with option not explicitly set.
+ function testAlwaysOnTopNoInit() {
+ testAlwaysOnTop('testAlwaysOnTopNoInit', false, false);
+ }
+
+ ]);
+});

Powered by Google App Engine
This is Rietveld 408576698