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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 chrome.test.runTests([ | 225 chrome.test.runTests([ |
226 function drawThenClearAttention() { | 226 function drawThenClearAttention() { |
227 chrome.app.window.create('test.html', {}, callbackPass(function(win) { | 227 chrome.app.window.create('test.html', {}, callbackPass(function(win) { |
228 win.drawAttention(); | 228 win.drawAttention(); |
229 win.clearAttention(); | 229 win.clearAttention(); |
230 })); | 230 })); |
231 } | 231 } |
232 ]); | 232 ]); |
233 } | 233 } |
234 | 234 |
| 235 function testFullscreen() { |
| 236 chrome.test.runTests([ |
| 237 function createFullscreen() { |
| 238 chrome.app.window.create('test.html', { |
| 239 state: 'fullscreen', |
| 240 }, callbackPass(function (win) { |
| 241 chrome.test.assertEq(win.contentWindow.screen.width, |
| 242 win.contentWindow.innerWidth); |
| 243 chrome.test.assertEq(win.contentWindow.screen.height, |
| 244 win.contentWindow.innerHeight); |
| 245 })); |
| 246 } |
| 247 ]); |
| 248 } |
| 249 |
235 chrome.app.runtime.onLaunched.addListener(function() { | 250 chrome.app.runtime.onLaunched.addListener(function() { |
236 chrome.test.sendMessage('Launched', function(reply) { | 251 chrome.test.sendMessage('Launched', function(reply) { |
237 window[reply](); | 252 window[reply](); |
238 }); | 253 }); |
239 }); | 254 }); |
OLD | NEW |