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

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: Merge 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..2865a12d179355be226bc17b88a05dff657e3b04
--- /dev/null
+++ b/chrome/test/data/extensions/platform_apps/windows_api_always_on_top/background.js
@@ -0,0 +1,46 @@
+// 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());
+
+ // Toggle the current value.
+ // TODO(tmdiep): The new value of isAlwaysOnTop() should be checked
+ // asynchronously, but we need a non-flaky way to do this.
+ win.setAlwaysOnTop(!initValue);
+
+ 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);
+ }
+
+ ]);
+});
« no previous file with comments | « chrome/test/base/test_browser_window.h ('k') | chrome/test/data/extensions/platform_apps/windows_api_always_on_top/index.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698