1 // Copyright 2013 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 chrome.app.runtime.onLaunched.addListener(function() {
6 chrome.app.window.create('index.html', {
13 chrome.test.log('Window opened callback.')
14 // Send message after "load" event to ensure the <window-controls> shadow
15 // element has had time to inject itself in the document.
16 win.contentWindow.addEventListener('load', function() {
17 chrome.test.log('onload event fired.')
18 chrome.test.sendMessage('window-opened');
20 win.contentWindow.addEventListener('click', function(e) {
21 chrome.test.log('click event fired at position (' + e.clientX + ',' +
24 // Send message to test when the window is closed (which should happen if
25 // if the test simulated a left click at the right location).
26 win.onClosed.addListener(function() {
27 chrome.test.log('onClosed event fired.')
28 chrome.test.sendMessage('window-closed');