OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "extensions/common/manifest.h" | 5 #include "extensions/common/manifest.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 &manifest, keys::kApp, new base::DictionaryValue()); | 152 &manifest, keys::kApp, new base::DictionaryValue()); |
153 AssertType(manifest.get(), Manifest::TYPE_LEGACY_PACKAGED_APP); | 153 AssertType(manifest.get(), Manifest::TYPE_LEGACY_PACKAGED_APP); |
154 | 154 |
155 // Platform app with event page. | 155 // Platform app with event page. |
156 MutateManifest( | 156 MutateManifest( |
157 &manifest, keys::kPlatformAppBackground, new base::DictionaryValue()); | 157 &manifest, keys::kPlatformAppBackground, new base::DictionaryValue()); |
158 AssertType(manifest.get(), Manifest::TYPE_PLATFORM_APP); | 158 AssertType(manifest.get(), Manifest::TYPE_PLATFORM_APP); |
159 MutateManifest( | 159 MutateManifest( |
160 &manifest, keys::kPlatformAppBackground, NULL); | 160 &manifest, keys::kPlatformAppBackground, NULL); |
161 | 161 |
162 // Platform app with service worker. | |
163 MutateManifest( | |
164 &manifest, keys::kPlatformAppServiceWorker, new base::DictionaryValue()); | |
165 AssertType(manifest.get(), Manifest::TYPE_PLATFORM_APP); | |
166 MutateManifest(&manifest, keys::kPlatformAppServiceWorker, NULL); | |
167 | |
168 // Hosted app. | 162 // Hosted app. |
169 MutateManifest( | 163 MutateManifest( |
170 &manifest, keys::kWebURLs, new base::ListValue()); | 164 &manifest, keys::kWebURLs, new base::ListValue()); |
171 AssertType(manifest.get(), Manifest::TYPE_HOSTED_APP); | 165 AssertType(manifest.get(), Manifest::TYPE_HOSTED_APP); |
172 MutateManifest( | 166 MutateManifest( |
173 &manifest, keys::kWebURLs, NULL); | 167 &manifest, keys::kWebURLs, NULL); |
174 MutateManifest( | 168 MutateManifest( |
175 &manifest, keys::kLaunchWebURL, new base::StringValue("foo")); | 169 &manifest, keys::kLaunchWebURL, new base::StringValue("foo")); |
176 AssertType(manifest.get(), Manifest::TYPE_HOSTED_APP); | 170 AssertType(manifest.get(), Manifest::TYPE_HOSTED_APP); |
177 MutateManifest( | 171 MutateManifest( |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 EXPECT_FALSE(manifest->Get(keys::kPageAction, &output)); | 212 EXPECT_FALSE(manifest->Get(keys::kPageAction, &output)); |
219 MutateManifest( | 213 MutateManifest( |
220 &manifest, keys::kPlatformAppBackground, NULL); | 214 &manifest, keys::kPlatformAppBackground, NULL); |
221 | 215 |
222 // Platform apps also can't have a "Commands" key. | 216 // Platform apps also can't have a "Commands" key. |
223 EXPECT_FALSE(manifest->HasKey(keys::kCommands)); | 217 EXPECT_FALSE(manifest->HasKey(keys::kCommands)); |
224 EXPECT_FALSE(manifest->Get(keys::kCommands, &output)); | 218 EXPECT_FALSE(manifest->Get(keys::kCommands, &output)); |
225 }; | 219 }; |
226 | 220 |
227 } // namespace extensions | 221 } // namespace extensions |
OLD | NEW |