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 var callbackFail = chrome.test.callbackFail; | 6 var callbackFail = chrome.test.callbackFail; |
7 var defaultFuzzFactor = 1; | 7 var defaultFuzzFactor = 1; |
8 | 8 |
9 function assertFuzzyEq(expected, actual, fuzzFactor, message) { | 9 function assertFuzzyEq(expected, actual, fuzzFactor, message) { |
10 if (!message) { | 10 if (!message) { |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 var cw2 = win2.contentWindow.chrome.app.window.current(); | 247 var cw2 = win2.contentWindow.chrome.app.window.current(); |
248 chrome.test.assertEq('testId1', cw1.id); | 248 chrome.test.assertEq('testId1', cw1.id); |
249 chrome.test.assertEq('testId2', cw2.id); | 249 chrome.test.assertEq('testId2', cw2.id); |
250 chrome.test.assertTrue(cw1 === win1); | 250 chrome.test.assertTrue(cw1 === win1); |
251 chrome.test.assertTrue(cw2 === win2); | 251 chrome.test.assertTrue(cw2 === win2); |
252 chrome.test.assertFalse(cw1 === cw2); | 252 chrome.test.assertFalse(cw1 === cw2); |
253 win1.contentWindow.close(); | 253 win1.contentWindow.close(); |
254 win2.contentWindow.close(); | 254 win2.contentWindow.close(); |
255 })); | 255 })); |
256 })); | 256 })); |
| 257 }, |
| 258 |
| 259 function hiddenAndNormal() { |
| 260 chrome.app.window.create('test.html', |
| 261 {hidden: true}, |
| 262 callbackPass(function(win1) { |
| 263 chrome.app.window.create('test.html', |
| 264 {hidden: false}, |
| 265 callbackPass(function(win2) { |
| 266 win1.contentWindow.close(); |
| 267 win2.contentWindow.close(); |
| 268 })); |
| 269 })); |
257 } | 270 } |
258 ]); | 271 ]); |
259 } | 272 } |
260 | 273 |
261 function testDeprecatedBounds() { | 274 function testDeprecatedBounds() { |
262 chrome.test.runTests([ | 275 chrome.test.runTests([ |
263 function contentSize() { | 276 function contentSize() { |
264 var options = { bounds: { left: 0, top: 0, width: 250, height: 200 } }; | 277 var options = { bounds: { left: 0, top: 0, width: 250, height: 200 } }; |
265 chrome.app.window.create('test.html', options, callbackPass( | 278 chrome.app.window.create('test.html', options, callbackPass( |
266 function(win) { | 279 function(win) { |
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1411 })); | 1424 })); |
1412 }, | 1425 }, |
1413 ]); | 1426 ]); |
1414 } | 1427 } |
1415 | 1428 |
1416 chrome.app.runtime.onLaunched.addListener(function() { | 1429 chrome.app.runtime.onLaunched.addListener(function() { |
1417 chrome.test.sendMessage('Launched', function(reply) { | 1430 chrome.test.sendMessage('Launched', function(reply) { |
1418 window[reply](); | 1431 window[reply](); |
1419 }); | 1432 }); |
1420 }); | 1433 }); |
OLD | NEW |