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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 var callbackPass = chrome.test.callbackPass;
6
7 function testAlwaysOnTop(testId, initValue) {
8 var options =
9 {
10 id: testId,
11 alwaysOnTop: initValue
12 };
13 chrome.app.window.create('index.html',
14 options,
15 callbackPass(function(win) {
16 chrome.test.assertEq(initValue, win.isAlwaysOnTop());
17 win.setAlwaysOnTop(!initValue);
18
19 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
20 chrome.test.assertEq(!initValue, win.isAlwaysOnTop());
21 win.contentWindow.close();
22 }), 500);
23 }));
24 }
25
26 chrome.app.runtime.onLaunched.addListener(function() {
27 chrome.test.runTests([
28
29 // Window is created with always on top enabled, then disabled after
30 // creation.
31 function testAlwaysOnTopInitTrue() {
32 testAlwaysOnTop('testAlwaysOnTopInitTrue', true);
33 },
34
35 // Window is created with always on top disabled, then enabled after
36 // creation.
37 function testAlwaysOnTopInitFalse() {
38 testAlwaysOnTop('testAlwaysOnTopInitFalse', false);
39 }
40
41 ]);
42 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698