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

Side by Side Diff: chrome/test/data/extensions/api_test/window_update/focus/test.html

Issue 8775046: Convert another batch of extension tests to manifest_version 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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
OLDNEW
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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698