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 // 'height' parameter prevents 'panel' windows form attempt to compute size as ynchronously. |
jennb
2011/11/24 01:04:56
s/form/from
| |
62 chrome.windows.create({'url': 'hello.html', 'type': windowType, 'height':100 } , | |
jennb
2011/11/24 01:04:56
might as well provide width too. it's pretty unusu
| |
62 pass(minimizeWindow)); | 63 pass(minimizeWindow)); |
63 } | 64 } |
64 | 65 |
65 chrome.test.runTests([ | 66 chrome.test.runTests([ |
66 function changeWindowState() { | 67 function changeWindowState() { |
67 testWindowState('normal'); | 68 testWindowState('normal'); |
68 }, | 69 }, |
69 function changePopupWindowState() { | 70 function changePopupWindowState() { |
70 testWindowState('popup'); | 71 testWindowState('popup'); |
71 }, | 72 }, |
72 function changePanelWindowState() { | 73 function changePanelWindowState() { |
73 testWindowState('panel'); | 74 testWindowState('panel'); |
74 } | 75 } |
75 ]); | 76 ]); |
76 </script> | 77 </script> |
OLD | NEW |