Chromium Code Reviews| Index: chrome/test/data/extensions/platform_apps/windows_api/test.js |
| diff --git a/chrome/test/data/extensions/platform_apps/windows_api/test.js b/chrome/test/data/extensions/platform_apps/windows_api/test.js |
| index 889c96dc4b3a47404743935c4116ad4fa020a98c..22c95074ed8a2a9d6712bc591bdd7dd37aa800e6 100644 |
| --- a/chrome/test/data/extensions/platform_apps/windows_api/test.js |
| +++ b/chrome/test/data/extensions/platform_apps/windows_api/test.js |
| @@ -7,12 +7,36 @@ var callbackPass = chrome.test.callbackPass; |
| chrome.app.runtime.onLaunched.addListener(function() { |
| chrome.test.runTests([ |
| function testCreateWindow() { |
| - chrome.app.window.create('test.html', {}, callbackPass(function (win) { |
| + chrome.app.window.create('test.html', |
| + {id: 'testId'}, |
| + callbackPass(function (win) { |
| chrome.test.assertTrue(typeof win.contentWindow.window === 'object'); |
| chrome.test.assertEq('about:blank', win.contentWindow.location.href); |
| chrome.test.assertEq('<html><head></head><body></body></html>', |
| win.contentWindow.document.documentElement.outerHTML); |
| - })) |
| + var cw = win.contentWindow.chrome.app.window.current(); |
| + chrome.test.assertEq(cw, win); |
|
benwells
2012/09/17 08:33:31
You only need one of these asserts. But an extra a
tapted
2012/09/17 09:22:13
Done.
|
| + chrome.test.assertTrue(cw === win); |
| + })); |
| + }, |
| + |
| + function testCreateMultiWindow() { |
| + chrome.test.assertTrue(null === chrome.app.window.current()); |
| + chrome.app.window.create('test.html', |
| + {id: 'testId1'}, |
| + callbackPass(function (win1) { |
| + chrome.app.window.create('test.html', |
| + {id: 'testId2'}, |
| + callbackPass(function (win2) { |
| + var cw1 = win1.contentWindow.chrome.app.window.current(); |
| + var cw2 = win2.contentWindow.chrome.app.window.current(); |
| + chrome.test.assertEq('testId1', cw1.id); |
| + chrome.test.assertEq('testId2', cw2.id); |
| + chrome.test.assertTrue(cw1 === win1); |
| + chrome.test.assertTrue(cw2 === win2); |
| + chrome.test.assertFalse(cw1 === cw2); |
| + })); |
| + })); |
| }, |
| function testUpdateWindowWidth() { |