1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 var pass
= chrome
.test
.callbackPass
;
10 var finalHeight
= 301;
12 var chromeWindow
= null;
14 function checkTop(currentWindow
) {
15 chrome
.test
.assertEq(finalTop
, currentWindow
.top
);
18 function checkHeightAndContinue(currentWindow
) {
19 chrome
.test
.assertEq(finalHeight
, currentWindow
.height
);
20 chrome
.windows
.update(
21 currentWindow
.id
, { 'top': finalTop
},
26 function checkWidthAndContinue(currentWindow
) {
27 chrome
.test
.assertEq(finalWidth
, currentWindow
.width
);
28 chrome
.windows
.update(
29 currentWindow
.id
, { 'height': finalHeight
},
30 pass(checkHeightAndContinue
)
34 function checkLeftAndContinue(currentWindow
) {
35 chrome
.test
.assertEq(finalLeft
, currentWindow
.left
);
36 chrome
.windows
.update(
37 currentWindow
.id
, { 'width': finalWidth
},
38 pass(checkWidthAndContinue
)
42 function updateLeftAndContinue(tab
) {
43 chrome
.windows
.update(
44 chromeWindow
.id
, { 'left': finalLeft
},
45 pass(checkLeftAndContinue
)
49 chrome
.test
.runTests([
50 function setResizeWindow() {
51 chrome
.windows
.getCurrent(
52 pass(function(currentWindow
) {
53 chromeWindow
= currentWindow
;
55 { 'windowId': currentWindow
.id
, 'url': 'blank.html' },
56 pass(updateLeftAndContinue
)