OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 var callbackPass = chrome.test.callbackPass; | 5 var callbackPass = chrome.test.callbackPass; |
6 | 6 |
7 function testWindowGetsFocus(win) { | 7 function testWindowGetsFocus(win) { |
8 // If the window is already focused, we are done. | 8 // If the window is already focused, we are done. |
9 if (win.contentWindow.document.hasFocus()) { | 9 if (win.contentWindow.document.hasFocus()) { |
10 chrome.test.assertTrue(win.contentWindow.document.hasFocus(), | 10 chrome.test.assertTrue(win.contentWindow.document.hasFocus(), |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 // We remove this and disable the entire test for Linux GTK when the | 214 // We remove this and disable the entire test for Linux GTK when the |
215 // test will run on other platforms, see http://crbug.com/328829 | 215 // test will run on other platforms, see http://crbug.com/328829 |
216 if (navigator.platform.indexOf('Linux') != 0) | 216 if (navigator.platform.indexOf('Linux') != 0) |
217 testWindowGetsFocus(win); | 217 testWindowGetsFocus(win); |
218 }); | 218 }); |
219 })); | 219 })); |
220 }, | 220 }, |
221 ]); | 221 ]); |
222 } | 222 } |
223 | 223 |
| 224 function testDrawAttention() { |
| 225 chrome.test.runTests([ |
| 226 function drawThenClearAttention() { |
| 227 chrome.app.window.create('test.html', {}, callbackPass(function(win) { |
| 228 win.drawAttention(); |
| 229 win.clearAttention(); |
| 230 })); |
| 231 } |
| 232 ]); |
| 233 } |
| 234 |
224 chrome.app.runtime.onLaunched.addListener(function() { | 235 chrome.app.runtime.onLaunched.addListener(function() { |
225 chrome.test.sendMessage('Launched', function(reply) { | 236 chrome.test.sendMessage('Launched', function(reply) { |
226 window[reply](); | 237 window[reply](); |
227 }); | 238 }); |
228 }); | 239 }); |
OLD | NEW |