Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: chrome/test/data/extensions/api_test/window_update/show_state/test.js

Issue 9328037: Add fullscreen state support for chrome.windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Separate FullscreenController related stuff to another patch set Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/extensions/docs/windows.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 ]);
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/windows.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698