OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 var enabled_app, disabled_app, enabled_extension, packaged_app; | 5 var enabled_app, disabled_app, enabled_extension, packaged_app; |
6 var allLaunchTypes = ["OPEN_AS_REGULAR_TAB", | 6 var allLaunchTypes = ["OPEN_AS_REGULAR_TAB", |
7 "OPEN_AS_PINNED_TAB", | 7 "OPEN_AS_PINNED_TAB", |
8 "OPEN_AS_WINDOW", | 8 "OPEN_AS_WINDOW", |
9 "OPEN_FULL_SCREEN"]; | 9 "OPEN_FULL_SCREEN"]; |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 function getAvailableLaunchTypes(app) { | 25 function getAvailableLaunchTypes(app) { |
26 var types = Array(); | 26 var types = Array(); |
27 if (app.type == "packaged_app") { | 27 if (app.type == "packaged_app") { |
28 types.push("OPEN_AS_WINDOW"); | 28 types.push("OPEN_AS_WINDOW"); |
29 return types; | 29 return types; |
30 } | 30 } |
31 | 31 |
32 types.push("OPEN_AS_REGULAR_TAB"); | 32 types.push("OPEN_AS_REGULAR_TAB"); |
33 types.push("OPEN_AS_WINDOW"); | 33 types.push("OPEN_AS_WINDOW"); |
34 | 34 |
| 35 if (navigator.userAgent.indexOf("CrOS") == -1) { |
| 36 types.push("OPEN_AS_PINNED_TAB"); |
| 37 types.push("OPEN_FULL_SCREEN"); |
| 38 } |
| 39 |
35 return types; | 40 return types; |
36 } | 41 } |
37 | 42 |
38 function verifyAvailableLaunchTypes(expected, actual) { | 43 function verifyAvailableLaunchTypes(expected, actual) { |
39 assertEq(expected.length, actual.length); | 44 assertEq(expected.length, actual.length); |
40 for (var i = 0; i < expected.length; i++) | 45 for (var i = 0; i < expected.length; i++) |
41 assertTrue(actual.indexOf(expected[i]) != -1); | 46 assertTrue(actual.indexOf(expected[i]) != -1); |
42 } | 47 } |
43 | 48 |
44 function testSetAllLaunchTypes(app) { | 49 function testSetAllLaunchTypes(app) { |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 ]; | 133 ]; |
129 | 134 |
130 chrome.management.getAll(callback(function(items) { | 135 chrome.management.getAll(callback(function(items) { |
131 enabled_app = getItemNamed(items, "enabled_app"); | 136 enabled_app = getItemNamed(items, "enabled_app"); |
132 disabled_app = getItemNamed(items, "disabled_app"); | 137 disabled_app = getItemNamed(items, "disabled_app"); |
133 enabled_extension = getItemNamed(items, "enabled_extension"); | 138 enabled_extension = getItemNamed(items, "enabled_extension"); |
134 packaged_app = getItemNamed(items, "packaged_app"); | 139 packaged_app = getItemNamed(items, "packaged_app"); |
135 | 140 |
136 chrome.test.runTests(tests); | 141 chrome.test.runTests(tests); |
137 })); | 142 })); |
OLD | NEW |