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

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