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

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

Issue 18741006: [GTK] Report isMinimized and correctly restore app windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Enable PlatformAppBrowserTest.WindowsApiProperties on GTK. Created 7 years, 5 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
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 current = chrome.app.window.current(); 5 var current = chrome.app.window.current();
6 var bg = null; 6 var bg = null;
7 var nextTestNumber = 1; 7 var nextTestNumber = 1;
8 8
9 function makeEventTest(eventName, startFunction) { 9 function makeEventTest(eventName, startFunction) {
10 var test = function() { 10 var test = function() {
(...skipping 21 matching lines...) Expand all
32 return test; 32 return test;
33 } 33 }
34 34
35 35
36 var tests = [ 36 var tests = [
37 37
38 makeEventTest('onMinimized', function() { current.minimize(); }), 38 makeEventTest('onMinimized', function() { current.minimize(); }),
39 makeEventTest('onMaximized', function() { current.maximize(); }), 39 makeEventTest('onMaximized', function() { current.maximize(); }),
40 makeEventTest('onRestored', function() { 40 makeEventTest('onRestored', function() {
41 current.minimize(); 41 current.minimize();
42 current.restore(); 42 current['onMinimized'].addListener(function() {
43 current.restore();
44 });
43 }), 45 }),
44 makeEventTest('onRestored', function() { 46 makeEventTest('onRestored', function() {
45 current.maximize(); 47 current.maximize();
46 current.restore(); 48 // Don't call |restore| immediately. On GTK+ platform the restore method
49 // will depend on the previous window state.
50 current['onMaximized'].addListener(function() {
51 current.restore();
52 })
47 }), 53 }),
48 makeEventTest('onBoundsChanged', function() { 54 makeEventTest('onBoundsChanged', function() {
49 current.setBounds({left:5, top:5, width:100, height:100}); 55 current.setBounds({left:5, top:5, width:100, height:100});
50 }) 56 })
51 57
52 ]; 58 ];
53 59
54 chrome.runtime.getBackgroundPage(function(page) { 60 chrome.runtime.getBackgroundPage(function(page) {
55 bg = page; 61 bg = page;
56 chrome.test.runTests(tests); 62 chrome.test.runTests(tests);
57 }); 63 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698