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
) {
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");