Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 }); | |
| OLD | NEW |