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

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: Fix default case handling 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
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 (thwWindow.type != 'panel') {
22 chrome.test.assertEq('fullscreen', theWindow.state);
23 chrome.test.assertTrue(width < theWindow.width ||
24 height < theWindow.height);
25 }
26 chrome.windows.update(theWindow.id, {'state': 'normal'},
27 pass(checkRestoreAfterFullscreen));
28 }
29
30 function checkRestoreWithBounds(theWindow) {
31 chrome.test.assertEq('normal', theWindow.state);
32 chrome.test.assertEq(width, theWindow.width);
33 chrome.test.assertEq(height, theWindow.height);
34
35 chrome.windows.update(theWindow.id, {'state': 'fullscreen'},
36 pass(checkFullscreen));
37 }
38
20 function checkMaximized(theWindow) { 39 function checkMaximized(theWindow) {
21 if (theWindow.type == 'panel') { 40 if (theWindow.type == 'panel') {
22 // Maximize is the same as restore for panels. 41 // Maximize is the same as restore for panels.
23 chrome.test.assertEq('normal', theWindow.state); 42 chrome.test.assertEq('normal', theWindow.state);
24 chrome.test.assertEq(width, theWindow.width); 43 chrome.test.assertEq(width, theWindow.width);
25 chrome.test.assertEq(height, theWindow.height); 44 chrome.test.assertEq(height, theWindow.height);
26 } else { 45 } else {
27 chrome.test.assertEq('maximized', theWindow.state); 46 chrome.test.assertEq('maximized', theWindow.state);
28 chrome.test.assertTrue(width < theWindow.width || 47 chrome.test.assertTrue(width < theWindow.width ||
29 height < theWindow.height); 48 height < theWindow.height);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 function changeWindowState() { 86 function changeWindowState() {
68 testWindowState('normal'); 87 testWindowState('normal');
69 }, 88 },
70 function changePopupWindowState() { 89 function changePopupWindowState() {
71 testWindowState('popup'); 90 testWindowState('popup');
72 }, 91 },
73 function changePanelWindowState() { 92 function changePanelWindowState() {
74 testWindowState('panel'); 93 testWindowState('panel');
75 } 94 }
76 ]); 95 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698