Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / chrome / test / data / extensions / management / launch_app / test.js
blob11b78ddbbaaeff8cd15022a873408e9f3c49ad71
1 // Copyright (c) 2011 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 window.onload = function() {
6 chrome.management.getAll(function(items) {
7 for (var i in items) {
8 var item = items[i];
9 if (item.name == "packaged_app") {
10 chrome.management.launchApp(item.id);
12 if (item.name == "simple_extension") {
13 // Try launching a non-app extension, which should fail.
14 var expected_error = "Extension " + item.id + " is not an App.";
15 chrome.management.launchApp(item.id, function() {
16 if (chrome.runtime.lastError &&
17 chrome.runtime.lastError.message == expected_error) {
18 chrome.test.sendMessage("got_expected_error");
20 });
23 });