Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / test / data / extensions / api_test / window_update / sizing / test.js
blobbdc59e7132eafbf972175bc023cf1a75fde7ccdf
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.
5 var pass = chrome.test.callbackPass;
7 var finalTop = 400;
8 var finalLeft = 10;
9 var finalWidth = 476
10 var finalHeight = 301;
12 var chromeWindow = null;
14 function checkTop(currentWindow) {
15 chrome.test.assertEq(finalTop, currentWindow.top);
18 function checkHeightAndContinue(currentWindow) {
19 chrome.test.assertEq(finalHeight, currentWindow.height);
20 chrome.windows.update(
21 currentWindow.id, { 'top': finalTop },
22 pass(checkTop)
26 function checkWidthAndContinue(currentWindow) {
27 chrome.test.assertEq(finalWidth, currentWindow.width);
28 chrome.windows.update(
29 currentWindow.id, { 'height': finalHeight },
30 pass(checkHeightAndContinue)
34 function checkLeftAndContinue(currentWindow) {
35 chrome.test.assertEq(finalLeft, currentWindow.left);
36 chrome.windows.update(
37 currentWindow.id, { 'width': finalWidth },
38 pass(checkWidthAndContinue)
42 function updateLeftAndContinue(tab) {
43 chrome.windows.update(
44 chromeWindow.id, { 'left': finalLeft},
45 pass(checkLeftAndContinue)
49 chrome.test.runTests([
50 function setResizeWindow() {
51 chrome.windows.getCurrent(
52 pass(function(currentWindow) {
53 chromeWindow = currentWindow;
54 chrome.tabs.create(
55 { 'windowId': currentWindow.id, 'url': 'blank.html' },
56 pass(updateLeftAndContinue)
58 }));
60 ]);