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

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

Issue 1511103003: Use rvalue reference instead of ExtensionBuilder::pass() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit change(dana review) Created 5 years 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 <utility> 7 #include <utility>
8 8
9 #include "extensions/common/extension.h" 9 #include "extensions/common/extension.h"
10 #include "extensions/common/extension_builder.h" 10 #include "extensions/common/extension_builder.h"
11 #include "extensions/common/value_builder.h" 11 #include "extensions/common/value_builder.h"
12 12
13 namespace extensions { 13 namespace extensions {
14 namespace test_util { 14 namespace test_util {
15 15
16 ExtensionBuilder& BuildExtension(ExtensionBuilder& builder) { 16 ExtensionBuilder BuildExtension(ExtensionBuilder builder) {
17 return builder 17 builder.SetManifest(DictionaryBuilder()
18 .SetManifest(DictionaryBuilder() 18 .Set("name", "Test extension")
19 .Set("name", "Test extension") 19 .Set("version", "1.0")
20 .Set("version", "1.0") 20 .Set("manifest_version", 2));
21 .Set("manifest_version", 2)); 21 return builder;
22 } 22 }
23 23
24 ExtensionBuilder& BuildApp(ExtensionBuilder& builder) { 24 ExtensionBuilder BuildApp(ExtensionBuilder builder) {
25 return builder.SetManifest( 25 builder.SetManifest(
26 DictionaryBuilder() 26 DictionaryBuilder()
27 .Set("name", "Test extension") 27 .Set("name", "Test extension")
28 .Set("version", "1.0") 28 .Set("version", "1.0")
29 .Set("manifest_version", 2) 29 .Set("manifest_version", 2)
30 .Set("app", 30 .Set("app",
31 extensions::DictionaryBuilder().Set( 31 extensions::DictionaryBuilder().Set(
32 "background", 32 "background",
33 extensions::DictionaryBuilder().Set( 33 extensions::DictionaryBuilder().Set(
34 "scripts", std::move(extensions::ListBuilder().Append( 34 "scripts", std::move(extensions::ListBuilder().Append(
35 "background.js")))))); 35 "background.js"))))));
36 return builder;
36 } 37 }
37 38
38 scoped_refptr<Extension> CreateEmptyExtension() { 39 scoped_refptr<Extension> CreateEmptyExtension() {
39 return ExtensionBuilder() 40 return ExtensionBuilder()
40 .SetManifest( 41 .SetManifest(
41 DictionaryBuilder().Set("name", "Test").Set("version", "1.0")) 42 DictionaryBuilder().Set("name", "Test").Set("version", "1.0"))
42 .Build(); 43 .Build();
43 } 44 }
44 45
45 scoped_refptr<Extension> CreateEmptyExtension(const std::string& id) { 46 scoped_refptr<Extension> CreateEmptyExtension(const std::string& id) {
46 return ExtensionBuilder() 47 return ExtensionBuilder()
47 .SetManifest( 48 .SetManifest(
48 DictionaryBuilder().Set("name", "test").Set("version", "0.1")) 49 DictionaryBuilder().Set("name", "test").Set("version", "0.1"))
49 .SetID(id) 50 .SetID(id)
50 .Build(); 51 .Build();
51 } 52 }
52 53
53 } // namespace test_util 54 } // namespace test_util
54 } // namespace extensions 55 } // 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