OLD | NEW |
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 widthDelta = 10; | 7 var widthDelta = 10; |
8 var heightDelta = 20; | 8 var heightDelta = 20; |
9 | 9 |
10 var expectedWidth; | 10 var expectedWidth; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 expectedHeight = currentWindow.height; | 46 expectedHeight = currentWindow.height; |
47 chrome.windows.update( | 47 chrome.windows.update( |
48 currentWindow.id, { 'width': expectedWidth }, | 48 currentWindow.id, { 'width': expectedWidth }, |
49 pass(changeHeight) | 49 pass(changeHeight) |
50 ); | 50 ); |
51 } | 51 } |
52 | 52 |
53 chrome.test.runTests([ | 53 chrome.test.runTests([ |
54 // Tests windows.update use of the chrome.windows.WINDOW_ID_CURRENT constant. | 54 // Tests windows.update use of the chrome.windows.WINDOW_ID_CURRENT constant. |
55 function testCurrentWindowResize() { | 55 function testCurrentWindowResize() { |
56 var newWidth = 400; | 56 var newWidth = 500; |
57 chrome.windows.create( | 57 chrome.windows.create( |
58 { 'url': 'blank.html', 'top': 0, 'left': 0, 'width': 500, 'height': 400, | 58 { 'url': 'blank.html', 'top': 0, 'left': 0, 'width': 500, 'height': 400, |
59 'type': 'normal' }, | 59 'type': 'normal' }, |
60 pass(function(win1) { | 60 pass(function(win1) { |
61 chrome.windows.getCurrent(pass(function(win2) { | 61 chrome.windows.getCurrent(pass(function(win2) { |
62 chrome.test.assertEq(win1.id, win2.id); | 62 chrome.test.assertEq(win1.id, win2.id); |
63 chrome.windows.update( | 63 chrome.windows.update( |
64 chrome.windows.WINDOW_ID_CURRENT, { 'width': newWidth }, | 64 chrome.windows.WINDOW_ID_CURRENT, { 'width': newWidth }, |
65 pass(function(win3) { | 65 pass(function(win3) { |
66 chrome.test.assertEq(win2.id, win3.id); | 66 chrome.test.assertEq(win2.id, win3.id); |
(...skipping 16 matching lines...) Expand all Loading... |
83 'type': 'popup' }, | 83 'type': 'popup' }, |
84 pass(changeWidth)); | 84 pass(changeWidth)); |
85 }, | 85 }, |
86 function testResizePanel() { | 86 function testResizePanel() { |
87 chrome.windows.create( | 87 chrome.windows.create( |
88 { 'url': 'blank.html', 'top': 0, 'left': 0, 'width': 150, 'height': 200, | 88 { 'url': 'blank.html', 'top': 0, 'left': 0, 'width': 150, 'height': 200, |
89 'type': 'panel' }, | 89 'type': 'panel' }, |
90 pass(changeWidth)); | 90 pass(changeWidth)); |
91 }, | 91 }, |
92 ]); | 92 ]); |
OLD | NEW |