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 (launchData) {
6 // Complete correctness of launchData is tested in another test.
7 chrome.test.assertTrue(typeof launchData !== 'undefined');
9 chrome.app.window.create(
13 win.contentWindow.onload = function() {
14 // Redirect the embedded webview to the same URL we've been launched
15 // with. This should not create an endless loop of redirecting on
16 // ourselves with multiplying windows.
17 var webview = win.contentWindow.document.getElementById('wv');
18 webview.addEventListener("loadstop", function() {
19 // The webview has successfully navigated. That means that redirection
20 // didn't happen, as expected.
21 chrome.test.sendMessage("Handler launched");
23 webview.src = launchData.url;