OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 window.onload = function() { | 5 window.onload = function() { |
6 chrome.management.getAll(function(items) { | 6 chrome.management.getAll(function(items) { |
7 for (var i in items) { | 7 for (var i in items) { |
8 var item = items[i]; | 8 var item = items[i]; |
9 if (item.name == "packaged_app") { | 9 if (item.name == "packaged_app") { |
10 chrome.management.launchApp(item.id); | 10 chrome.management.launchApp(item.id); |
11 } | 11 } |
12 if (item.name == "simple_extension") { | 12 if (item.name == "simple_extension") { |
13 // Try launching a non-app extension, which should fail. | 13 // Try launching a non-app extension, which should fail. |
14 var expected_error = "Extension " + item.id + " is not an App"; | 14 var expected_error = "Extension " + item.id + " is not an App."; |
15 chrome.management.launchApp(item.id, function() { | 15 chrome.management.launchApp(item.id, function() { |
16 if (chrome.runtime.lastError && | 16 if (chrome.runtime.lastError && |
17 chrome.runtime.lastError.message == expected_error) { | 17 chrome.runtime.lastError.message == expected_error) { |
18 chrome.test.sendMessage("got_expected_error"); | 18 chrome.test.sendMessage("got_expected_error"); |
19 } | 19 } |
20 }); | 20 }); |
21 } | 21 } |
22 } | 22 } |
23 }); | 23 }); |
24 }; | 24 }; |
25 | 25 |
OLD | NEW |