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

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: 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 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, setOption) {
8 var options = { id: testId };
9 if (setOption)
10 options.alwaysOnTop = initValue;
11
12 chrome.app.window.create('index.html',
13 options,
14 callbackPass(function(win) {
15 // Check that isAlwaysOnTop() returns the initial value.
16 chrome.test.assertEq(initValue, win.isAlwaysOnTop());
17
18 // Toggle the current value.
19 // TODO(tmdiep): The new value of isAlwaysOnTop() should be checked
20 // asynchronously, but we need a non-flaky way to do this.
21 win.setAlwaysOnTop(!initValue);
22
23 win.contentWindow.close();
24 }));
25 }
26
27 chrome.app.runtime.onLaunched.addListener(function() {
28 chrome.test.runTests([
29
30 // Window is created with always on top enabled.
31 function testAlwaysOnTopInitTrue() {
32 testAlwaysOnTop('testAlwaysOnTopInitTrue', true, true);
33 },
34
35 // Window is created with always on top explicitly disabled.
36 function testAlwaysOnTopInitFalse() {
37 testAlwaysOnTop('testAlwaysOnTopInitFalse', false, true);
38 },
39
40 // Window is created with option not explicitly set.
41 function testAlwaysOnTopNoInit() {
42 testAlwaysOnTop('testAlwaysOnTopNoInit', false, false);
43 }
44
45 ]);
46 });
OLDNEW
« 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