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

Side by Side Diff: chrome/test/data/extensions/platform_apps/windows_api_always_on_top/has_permissions_stable/background.js

Issue 159523002: Promote chrome.app.window alwaysOnTop property to stable unwhitelisted (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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, value) {
8 var options = {
9 id: testId,
10 alwaysOnTop: value
11 };
12
13 chrome.app.window.create('index.html',
14 options,
15 callbackPass(function(win) {
16 // Check that isAlwaysOnTop() returns false because the feature is not
17 // permitted in Stable.
18 chrome.test.assertEq(false, win.isAlwaysOnTop());
19
20 // Attempt to use setAlwaysOnTop() to change the property. But this should
21 // also fail.
22 win.setAlwaysOnTop(value);
23
24 // setAlwaysOnTop is synchronous in the browser, so send an async request to
25 // ensure we get the updated value of isAlwaysOnTop.
26 chrome.runtime.getPlatformInfo(callbackPass(function(platformInfo) {
27 // Check that isAlwaysOnTop() returns false.
28 chrome.test.assertEq(false, win.isAlwaysOnTop());
29
30 win.contentWindow.close();
31 }));
32 }));
33 }
34
35 chrome.app.runtime.onLaunched.addListener(function() {
36 chrome.test.runTests([
37
38 // Try to enable alwaysOnTop on window creation and after window creation.
39 function testAlwaysOnTopEnable() {
40 testAlwaysOnTop('testAlwaysOnTopEnable', true);
41 },
42
43 // Try to disable alwaysOnTop on window creation and after window creation.
44 function testAlwaysOnTopDisable() {
45 testAlwaysOnTop('testAlwaysOnTopDisable', false);
46 }
47
48 ]);
49 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698