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

Side by Side Diff: chrome/test/data/extensions/platform_apps/windows_api/main.js

Issue 10080017: Switch platform apps from a declarative launch container to handling an onLaunched event. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: remove debug logging code Created 8 years, 8 months 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) 2012 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 callbackPass = chrome.test.callbackPass;
6
7 // Only a few chrome.windows.* API methods are tested, it is assumed that the
8 // full API is tested elsewhere.
9 chrome.test.runTests([
10 function testGetCurrentWindow() {
11 chrome.windows.getCurrent(callbackPass(function(window) {
12 chrome.test.assertEq(250, window.width);
13 chrome.test.assertEq('shell', window.type);
14 }));
15 },
16
17 function testUpdateWindowWidth() {
18 chrome.windows.getCurrent(callbackPass(function(window) {
19 chrome.windows.update(
20 window.id, {width: 300}, callbackPass(function() {
21 // The timeout is rather lame, but reading back the width from the
22 // window manager (on Linux) immediately still reports the old
23 // value.
24 setTimeout(callbackPass(function() {
25 chrome.windows.getCurrent(callbackPass(function(window) {
26 chrome.test.assertEq(300, window.width);
27 }));
28 }), 100);
29 }));
30 }));
31 },
32
33 function testCreateWindow() {
34 var getShellWindowCount = function(callback) {
35 chrome.windows.getAll(function(windows) {
36 callback(windows.filter(
37 function(window) { return window.type == 'shell'}).length);
38 });
39 };
40
41 getShellWindowCount(callbackPass(function(shellWindowCount) {
42 chrome.test.assertEq(1, shellWindowCount);
43 chrome.windows.create({type: 'shell'}, callbackPass(function() {
44 getShellWindowCount(callbackPass(function(shellWindowCount) {
45 chrome.test.assertEq(2, shellWindowCount);
46 }));
47 }));
48 }));
49 }
50 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698