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

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

Issue 10878040: Move context-sensitive app.window.* functions to app.window.current().* (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 8 years, 3 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var callbackPass = chrome.test.callbackPass; 5 var callbackPass = chrome.test.callbackPass;
6 6
7 chrome.app.runtime.onLaunched.addListener(function() { 7 chrome.app.runtime.onLaunched.addListener(function() {
8 chrome.test.runTests([ 8 chrome.test.runTests([
9 function testCreateWindow() { 9 function testCreateWindow() {
10 chrome.app.window.create('test.html', {}, callbackPass(function (win) { 10 chrome.app.window.create('test.html', {}, callbackPass(function (win) {
11 chrome.test.assertTrue(typeof win.window === 'object'); 11 chrome.test.assertTrue(typeof win.dom.window === 'object');
12 chrome.test.assertEq('about:blank', win.location.href); 12 chrome.test.assertEq('about:blank', win.dom.location.href);
13 chrome.test.assertEq('<html><head></head><body></body></html>', 13 chrome.test.assertEq('<html><head></head><body></body></html>',
14 win.document.documentElement.outerHTML); 14 win.dom.document.documentElement.outerHTML);
15 })) 15 }))
16 }, 16 },
17 17
18 function testUpdateWindowWidth() { 18 function testUpdateWindowWidth() {
19 chrome.app.window.create('test.html', 19 chrome.app.window.create('test.html',
20 {width:512, height:384, frame:'custom'}, 20 {width:512, height:384, frame:'custom'},
21 callbackPass(function(win) { 21 callbackPass(function(win) {
22 chrome.test.assertEq(512, win.innerWidth); 22 chrome.test.assertEq(512, win.dom.innerWidth);
23 chrome.test.assertEq(384, win.innerHeight); 23 chrome.test.assertEq(384, win.dom.innerHeight);
24 var oldWidth = win.outerWidth, oldHeight = win.outerHeight; 24 var oldWidth = win.dom.outerWidth, oldHeight = win.dom.outerHeight;
25 win.resizeBy(-256, 0); 25 win.dom.resizeBy(-256, 0);
26 chrome.test.assertEq(oldWidth - 256, win.outerWidth); 26 chrome.test.assertEq(oldWidth - 256, win.dom.outerWidth);
27 chrome.test.assertEq(oldHeight, win.outerHeight); 27 chrome.test.assertEq(oldHeight, win.dom.outerHeight);
28 })); 28 }));
29 }, 29 },
30 30
31 /*function testMaximize() { 31 /*function testMaximize() {
32 chrome.app.window.create('test.html', {width: 200, height: 200}, 32 chrome.app.window.create('test.html', {width: 200, height: 200},
33 callbackPass(function(win) { 33 callbackPass(function(win) {
34 win.onresize = callbackPass(function(e) { 34 win.onresize = callbackPass(function(e) {
35 // Crude test to check we're somewhat maximized. 35 // Crude test to check we're somewhat maximized.
36 chrome.test.assertTrue( 36 chrome.test.assertTrue(
37 win.outerHeight > screen.availHeight * 0.8); 37 win.outerHeight > screen.availHeight * 0.8);
(...skipping 22 matching lines...) Expand all
60 chrome.test.assertEq(oldHeight, win.innerHeight); 60 chrome.test.assertEq(oldHeight, win.innerHeight);
61 }); 61 });
62 }) 62 })
63 win.chrome.app.window.restore(); 63 win.chrome.app.window.restore();
64 }); 64 });
65 win.chrome.app.window.maximize(); 65 win.chrome.app.window.maximize();
66 })); 66 }));
67 },*/ 67 },*/
68 ]); 68 ]);
69 }); 69 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698