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

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: Cache state of isAlwaysOnTop in widget. Fixed clobber in x11 window init. 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..f89a25e6e9ac1a09c4256d8aadba1326a4beb329
--- /dev/null
+++ b/chrome/test/data/extensions/platform_apps/windows_api_always_on_top/background.js
@@ -0,0 +1,42 @@
+// 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) {
+ var options =
+ {
+ id: testId,
+ alwaysOnTop: initValue
+ };
+ chrome.app.window.create('index.html',
+ options,
+ callbackPass(function(win) {
+ chrome.test.assertEq(initValue, win.isAlwaysOnTop());
+ win.setAlwaysOnTop(!initValue);
+
+ setTimeout(callbackPass(function() {
benwells 2013/10/09 02:00:50 Is there any way to test this without relying on a
tmdiep 2013/10/09 06:18:08 It is tricky to test whether the window is actuall
+ chrome.test.assertEq(!initValue, win.isAlwaysOnTop());
+ win.contentWindow.close();
+ }), 500);
+ }));
+}
+
+chrome.app.runtime.onLaunched.addListener(function() {
+ chrome.test.runTests([
+
+ // Window is created with always on top enabled, then disabled after
+ // creation.
+ function testAlwaysOnTopInitTrue() {
+ testAlwaysOnTop('testAlwaysOnTopInitTrue', true);
+ },
+
+ // Window is created with always on top disabled, then enabled after
+ // creation.
+ function testAlwaysOnTopInitFalse() {
+ testAlwaysOnTop('testAlwaysOnTopInitFalse', false);
+ }
+
+ ]);
+});

Powered by Google App Engine
This is Rietveld 408576698