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

Side by Side Diff: extensions/common/test_util.cc

Issue 594003002: Added unit tests for ChromePermissionMessageProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed up comments/naming Created 6 years, 2 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
« no previous file with comments | « extensions/common/test_util.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "extensions/common/test_util.h" 5 #include "extensions/common/test_util.h"
6 6
7 #include "extensions/common/extension.h" 7 #include "extensions/common/extension.h"
8 #include "extensions/common/extension_builder.h" 8 #include "extensions/common/extension_builder.h"
9 #include "extensions/common/value_builder.h" 9 #include "extensions/common/value_builder.h"
10 10
11 namespace extensions { 11 namespace extensions {
12 namespace test_util { 12 namespace test_util {
13 13
14 ExtensionBuilder& BuildExtension(ExtensionBuilder& builder) { 14 ExtensionBuilder& BuildExtension(ExtensionBuilder& builder) {
15 return builder 15 return builder
16 .SetManifest(DictionaryBuilder() 16 .SetManifest(DictionaryBuilder()
17 .Set("name", "Test extension") 17 .Set("name", "Test extension")
18 .Set("version", "1.0") 18 .Set("version", "1.0")
19 .Set("manifest_version", 2)); 19 .Set("manifest_version", 2));
20 } 20 }
21 21
22 ExtensionBuilder& BuildApp(ExtensionBuilder& builder) {
23 return builder.SetManifest(
24 DictionaryBuilder()
25 .Set("name", "Test extension")
26 .Set("version", "1.0")
27 .Set("manifest_version", 2)
28 .Set("app",
29 extensions::DictionaryBuilder().Set(
30 "background",
31 extensions::DictionaryBuilder().Set(
32 "scripts",
33 extensions::ListBuilder().Append("background.js")))));
34 }
35
22 scoped_refptr<Extension> CreateEmptyExtension() { 36 scoped_refptr<Extension> CreateEmptyExtension() {
23 return ExtensionBuilder() 37 return ExtensionBuilder()
24 .SetManifest( 38 .SetManifest(
25 DictionaryBuilder().Set("name", "Test").Set("version", "1.0")) 39 DictionaryBuilder().Set("name", "Test").Set("version", "1.0"))
26 .Build(); 40 .Build();
27 } 41 }
28 42
29 scoped_refptr<Extension> CreateEmptyExtension(const std::string& id) { 43 scoped_refptr<Extension> CreateEmptyExtension(const std::string& id) {
30 return ExtensionBuilder() 44 return ExtensionBuilder()
31 .SetManifest( 45 .SetManifest(
32 DictionaryBuilder().Set("name", "test").Set("version", "0.1")) 46 DictionaryBuilder().Set("name", "test").Set("version", "0.1"))
33 .SetID(id) 47 .SetID(id)
34 .Build(); 48 .Build();
35 } 49 }
36 50
37 } // namespace test_util 51 } // namespace test_util
38 } // namespace extensions 52 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/common/test_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698