| OLD | NEW |
| 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 chrome.app.runtime.onLaunched.addListener(function() { | 5 chrome.app.runtime.onLaunched.addListener(function() { |
| 6 chrome.test.sendMessage("Launched"); |
| 6 chrome.app.window.create("main.html", function(win){ | 7 chrome.app.window.create("main.html", function(win){ |
| 7 // Make sure we get back a bounds and that it isn't all 0's. | 8 // Make sure we get back a bounds and that it isn't all 0's. |
| 8 var bounds = win.getBounds(); | 9 var bounds = win.getBounds(); |
| 9 if (!bounds || | 10 if (!bounds || |
| 10 (bounds.top == 0 && bounds.left == 0 && | 11 (bounds.top == 0 && bounds.left == 0 && |
| 11 bounds.width == 0 && bounds.height == 0)) { | 12 bounds.width == 0 && bounds.height == 0)) { |
| 12 console.error("invalid bounds after app.window.create:" + | 13 console.error("invalid bounds after app.window.create:" + |
| 13 JSON.stringify(bounds)); | 14 JSON.stringify(bounds)); |
| 14 win.close(); | 15 win.close(); |
| 15 window.close(); | 16 window.close(); |
| 16 } else { | 17 } else { |
| 17 chrome.test.sendMessage("background_ok"); | 18 chrome.test.sendMessage("background_ok"); |
| 18 } | 19 } |
| 19 }); | 20 }); |
| 20 }); | 21 }); |
| OLD | NEW |