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

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

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

Powered by Google App Engine
This is Rietveld 408576698