Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 pass = chrome.test.callbackPass; | 5 var pass = chrome.test.callbackPass; |
| 6 | 6 |
| 7 var width = 0; | 7 var width = 0; |
| 8 var height = 0; | 8 var height = 0; |
| 9 | 9 |
| 10 var deltaWidth = 20; | 10 var deltaWidth = 20; |
| 11 var deltaHeight = 30; | 11 var deltaHeight = 30; |
| 12 | 12 |
| 13 function checkRestoreWithBounds(theWindow) { | 13 function checkRestoreAfterFullscreen(theWindow) { |
| 14 chrome.test.assertEq('normal', theWindow.state); | 14 chrome.test.assertEq('normal', theWindow.state); |
| 15 chrome.test.assertEq(width, theWindow.width); | 15 chrome.test.assertEq(width, theWindow.width); |
| 16 chrome.test.assertEq(height, theWindow.height); | 16 chrome.test.assertEq(height, theWindow.height); |
| 17 chrome.windows.remove(theWindow.id, pass()); | 17 chrome.windows.remove(theWindow.id, pass()); |
| 18 } | 18 } |
| 19 | 19 |
| 20 function checkFullscreen(theWindow) { | |
| 21 if (theWindow.type != 'panel') | |
|
jennb
2012/02/07 18:41:38
Can you set the panel case to check that the state
hashimoto
2012/02/08 04:22:35
Done.
| |
| 22 chrome.test.assertEq('fullscreen', theWindow.state); | |
|
hashimoto
2012/02/07 11:53:17
Not checking size here because BrowserWindowCocoa
| |
| 23 chrome.windows.update(theWindow.id, {'state': 'normal'}, | |
| 24 pass(checkRestoreAfterFullscreen)); | |
| 25 } | |
| 26 | |
| 27 function checkRestoreWithBounds(theWindow) { | |
| 28 chrome.test.assertEq('normal', theWindow.state); | |
| 29 chrome.test.assertEq(width, theWindow.width); | |
| 30 chrome.test.assertEq(height, theWindow.height); | |
| 31 | |
| 32 chrome.windows.update(theWindow.id, {'state': 'fullscreen'}, | |
| 33 pass(checkFullscreen)); | |
| 34 } | |
| 35 | |
| 20 function checkMaximized(theWindow) { | 36 function checkMaximized(theWindow) { |
| 21 if (theWindow.type == 'panel') { | 37 if (theWindow.type == 'panel') { |
| 22 // Maximize is the same as restore for panels. | 38 // Maximize is the same as restore for panels. |
| 23 chrome.test.assertEq('normal', theWindow.state); | 39 chrome.test.assertEq('normal', theWindow.state); |
| 24 chrome.test.assertEq(width, theWindow.width); | 40 chrome.test.assertEq(width, theWindow.width); |
| 25 chrome.test.assertEq(height, theWindow.height); | 41 chrome.test.assertEq(height, theWindow.height); |
| 26 } else { | 42 } else { |
| 27 chrome.test.assertEq('maximized', theWindow.state); | 43 chrome.test.assertEq('maximized', theWindow.state); |
| 28 chrome.test.assertTrue(width < theWindow.width || | 44 chrome.test.assertTrue(width < theWindow.width || |
| 29 height < theWindow.height); | 45 height < theWindow.height); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 67 function changeWindowState() { | 83 function changeWindowState() { |
| 68 testWindowState('normal'); | 84 testWindowState('normal'); |
| 69 }, | 85 }, |
| 70 function changePopupWindowState() { | 86 function changePopupWindowState() { |
| 71 testWindowState('popup'); | 87 testWindowState('popup'); |
| 72 }, | 88 }, |
| 73 function changePanelWindowState() { | 89 function changePanelWindowState() { |
| 74 testWindowState('panel'); | 90 testWindowState('panel'); |
| 75 } | 91 } |
| 76 ]); | 92 ]); |
| OLD | NEW |