Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: chrome/common/extensions/manifest_unittest.cc

Issue 178253007: Parse manifest file with app.service_worker.script. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved test utils out of base Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 &manifest, keys::kExport, new base::DictionaryValue()); 145 &manifest, keys::kExport, new base::DictionaryValue());
146 AssertType(manifest.get(), Manifest::TYPE_SHARED_MODULE); 146 AssertType(manifest.get(), Manifest::TYPE_SHARED_MODULE);
147 MutateManifest( 147 MutateManifest(
148 &manifest, keys::kExport, NULL); 148 &manifest, keys::kExport, NULL);
149 149
150 // Packaged app. 150 // Packaged app.
151 MutateManifest( 151 MutateManifest(
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. 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
162 // Hosted app. 168 // Hosted app.
163 MutateManifest( 169 MutateManifest(
164 &manifest, keys::kWebURLs, new base::ListValue()); 170 &manifest, keys::kWebURLs, new base::ListValue());
165 AssertType(manifest.get(), Manifest::TYPE_HOSTED_APP); 171 AssertType(manifest.get(), Manifest::TYPE_HOSTED_APP);
166 MutateManifest( 172 MutateManifest(
167 &manifest, keys::kWebURLs, NULL); 173 &manifest, keys::kWebURLs, NULL);
168 MutateManifest( 174 MutateManifest(
169 &manifest, keys::kLaunchWebURL, new base::StringValue("foo")); 175 &manifest, keys::kLaunchWebURL, new base::StringValue("foo"));
170 AssertType(manifest.get(), Manifest::TYPE_HOSTED_APP); 176 AssertType(manifest.get(), Manifest::TYPE_HOSTED_APP);
171 MutateManifest( 177 MutateManifest(
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 EXPECT_FALSE(manifest->Get(keys::kPageAction, &output)); 218 EXPECT_FALSE(manifest->Get(keys::kPageAction, &output));
213 MutateManifest( 219 MutateManifest(
214 &manifest, keys::kPlatformAppBackground, NULL); 220 &manifest, keys::kPlatformAppBackground, NULL);
215 221
216 // Platform apps also can't have a "Commands" key. 222 // Platform apps also can't have a "Commands" key.
217 EXPECT_FALSE(manifest->HasKey(keys::kCommands)); 223 EXPECT_FALSE(manifest->HasKey(keys::kCommands));
218 EXPECT_FALSE(manifest->Get(keys::kCommands, &output)); 224 EXPECT_FALSE(manifest->Get(keys::kCommands, &output));
219 }; 225 };
220 226
221 } // namespace extensions 227 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/manifest_tests/extension_manifests_service_worker_unittest.cc ('k') | extensions/common/manifest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698