| 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 previousTop = 0; | 4 * LICENSE file. |
| 5 var left = 0; | 5 --> |
| 6 var width = 0; | 6 <script src="test.js"></script> |
| 7 var height = 0; | |
| 8 | |
| 9 var chromeWindow = null; | |
| 10 | |
| 11 function checkDimensions(currentWindow) { | |
| 12 chrome.test.assertEq(previousTop, currentWindow.top); | |
| 13 chrome.test.assertEq(left, currentWindow.left); | |
| 14 chrome.test.assertEq(width, currentWindow.width); | |
| 15 chrome.test.assertEq(height, currentWindow.height); | |
| 16 } | |
| 17 | |
| 18 function setFocus(tab) { | |
| 19 previousTop = chromeWindow.top; | |
| 20 left = chromeWindow.left; | |
| 21 width = chromeWindow.width; | |
| 22 height = chromeWindow.height; | |
| 23 | |
| 24 chrome.windows.update( | |
| 25 chromeWindow.id, { 'focused': true }, | |
| 26 pass(checkDimensions) | |
| 27 ); | |
| 28 } | |
| 29 | |
| 30 chrome.test.runTests([ | |
| 31 function setFocusWithNoResize() { | |
| 32 chrome.windows.getCurrent( | |
| 33 pass(function(currentWindow) { | |
| 34 chromeWindow = currentWindow; | |
| 35 chrome.tabs.create( | |
| 36 { 'windowId': currentWindow.id, 'url': 'blank.html' }, | |
| 37 pass(setFocus) | |
| 38 ); | |
| 39 })); | |
| 40 } | |
| 41 ]); | |
| 42 </script> | |
| OLD | NEW |