OLD | NEW |
1 <script> | 1 <!-- |
2 var pass = chrome.test.callbackPass; | 2 * Copyright (c) 2011 The Chromium Authors. All rights reserved. Use of this |
3 | 3 * source code is governed by a BSD-style license that can be found in the |
4 var finalTop = 400; | 4 * LICENSE file. |
5 var finalLeft = 10; | 5 --> |
6 var finalWidth = 476 | 6 <script src="test.js"></script> |
7 var finalHeight = 301; | |
8 | |
9 var chromeWindow = null; | |
10 | |
11 function checkTop(currentWindow) { | |
12 chrome.test.assertEq(finalTop, currentWindow.top); | |
13 } | |
14 | |
15 function checkHeightAndContinue(currentWindow) { | |
16 chrome.test.assertEq(finalHeight, currentWindow.height); | |
17 chrome.windows.update( | |
18 currentWindow.id, { 'top': finalTop }, | |
19 pass(checkTop) | |
20 ); | |
21 } | |
22 | |
23 function checkWidthAndContinue(currentWindow) { | |
24 chrome.test.assertEq(finalWidth, currentWindow.width); | |
25 chrome.windows.update( | |
26 currentWindow.id, { 'height': finalHeight }, | |
27 pass(checkHeightAndContinue) | |
28 ); | |
29 } | |
30 | |
31 function checkLeftAndContinue(currentWindow) { | |
32 chrome.test.assertEq(finalLeft, currentWindow.left); | |
33 chrome.windows.update( | |
34 currentWindow.id, { 'width': finalWidth }, | |
35 pass(checkWidthAndContinue) | |
36 ); | |
37 } | |
38 | |
39 function updateLeftAndContinue(tab) { | |
40 chrome.windows.update( | |
41 chromeWindow.id, { 'left': finalLeft}, | |
42 pass(checkLeftAndContinue) | |
43 ); | |
44 } | |
45 | |
46 chrome.test.runTests([ | |
47 function setResizeWindow() { | |
48 chrome.windows.getCurrent( | |
49 pass(function(currentWindow) { | |
50 chromeWindow = currentWindow; | |
51 chrome.tabs.create( | |
52 { 'windowId': currentWindow.id, 'url': 'blank.html' }, | |
53 pass(updateLeftAndContinue) | |
54 ); | |
55 })); | |
56 }, | |
57 ]); | |
58 </script> | |
OLD | NEW |