Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / extensions / test / data / web_view / close_on_loadcommit / test.js
blobcae0a14428accfdec1e6cee8fe9c9afa3b9ab9ee
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.
4 var createCount = 0;
6 var launchWindow = function() {
7 chrome.app.window.create('main.html', {}, function (win) {
8 if (createCount == 0)
9 chrome.test.sendMessage('LAUNCHED');
10 if (createCount < 3) {
11 ++createCount;
12 chrome.test.log('Attempt no #' + createCount);
13 win.close();
14 launchWindow();
15 } else {
16 chrome.test.sendMessage('done-close-on-loadcommit');
18 });
21 chrome.app.runtime.onLaunched.addListener(function() {
22 launchWindow();
23 });