OLD | NEW |
1 <script> | 1 <script> |
2 var pass = chrome.test.callbackPass; | 2 var pass = chrome.test.callbackPass; |
3 | 3 |
4 var width = 0; | 4 var width = 0; |
5 var height = 0; | 5 var height = 0; |
6 var changedWidth = 500; | 6 var changedWidth = 500; |
7 var changedHeight = 500; | 7 var changedHeight = 500; |
8 | 8 |
9 function checkRestoreWithBounds(theWindow) { | 9 function checkRestoreWithBounds(theWindow) { |
10 chrome.test.assertEq('normal', theWindow.state); | 10 chrome.test.assertEq('normal', theWindow.state); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 } | 51 } |
52 | 52 |
53 function minimizeWindow(theWindow) { | 53 function minimizeWindow(theWindow) { |
54 chrome.test.assertEq('normal', theWindow.state); | 54 chrome.test.assertEq('normal', theWindow.state); |
55 width = theWindow.width; | 55 width = theWindow.width; |
56 height = theWindow.height; | 56 height = theWindow.height; |
57 chrome.windows.update(theWindow.id, {'state': 'minimized'}, pass(checkMinimize
d)); | 57 chrome.windows.update(theWindow.id, {'state': 'minimized'}, pass(checkMinimize
d)); |
58 } | 58 } |
59 | 59 |
60 function testWindowState(windowType) { | 60 function testWindowState(windowType) { |
61 chrome.windows.create({'url': 'hello.html', 'type': windowType}, | 61 // Specifying size prevents 'panel' windows from computing size asynchronously
. It ensures |
| 62 // panel sizes stay fixed through the test. |
| 63 chrome.windows.create({'url': 'hello.html', 'type': windowType, 'width':100, '
height':100 }, |
62 pass(minimizeWindow)); | 64 pass(minimizeWindow)); |
63 } | 65 } |
64 | 66 |
65 chrome.test.runTests([ | 67 chrome.test.runTests([ |
66 function changeWindowState() { | 68 function changeWindowState() { |
67 testWindowState('normal'); | 69 testWindowState('normal'); |
68 }, | 70 }, |
69 function changePopupWindowState() { | 71 function changePopupWindowState() { |
70 testWindowState('popup'); | 72 testWindowState('popup'); |
71 }, | 73 }, |
72 function changePanelWindowState() { | 74 function changePanelWindowState() { |
73 testWindowState('panel'); | 75 testWindowState('panel'); |
74 } | 76 } |
75 ]); | 77 ]); |
76 </script> | 78 </script> |
OLD | NEW |