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

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

Issue 2037703004: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/extension_set.h" 5 #include "extensions/common/extension_set.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 20 matching lines...) Expand all
31 base::DictionaryValue manifest; 31 base::DictionaryValue manifest;
32 manifest.SetString("name", name); 32 manifest.SetString("name", name);
33 manifest.SetString("version", "1"); 33 manifest.SetString("version", "1");
34 34
35 if (!launch_url.empty()) 35 if (!launch_url.empty())
36 manifest.SetString("app.launch.web_url", launch_url); 36 manifest.SetString("app.launch.web_url", launch_url);
37 37
38 if (!extent.empty()) { 38 if (!extent.empty()) {
39 base::ListValue* urls = new base::ListValue(); 39 base::ListValue* urls = new base::ListValue();
40 manifest.Set("app.urls", urls); 40 manifest.Set("app.urls", urls);
41 urls->Append(new base::StringValue(extent)); 41 urls->AppendString(extent);
42 } 42 }
43 43
44 std::string error; 44 std::string error;
45 scoped_refptr<Extension> extension( 45 scoped_refptr<Extension> extension(
46 Extension::Create(path, Manifest::INTERNAL, manifest, 46 Extension::Create(path, Manifest::INTERNAL, manifest,
47 Extension::NO_FLAGS, &error)); 47 Extension::NO_FLAGS, &error));
48 EXPECT_TRUE(extension.get()) << error; 48 EXPECT_TRUE(extension.get()) << error;
49 return extension; 49 return extension;
50 } 50 }
51 51
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 141
142 ASSERT_TRUE(extensions.Contains(ext3->id())); 142 ASSERT_TRUE(extensions.Contains(ext3->id()));
143 ASSERT_TRUE(extensions.InsertAll(*to_add)); 143 ASSERT_TRUE(extensions.InsertAll(*to_add));
144 EXPECT_EQ(4u, extensions.size()); 144 EXPECT_EQ(4u, extensions.size());
145 145
146 ASSERT_FALSE(extensions.InsertAll(*to_add)); // Re-adding same set no-ops. 146 ASSERT_FALSE(extensions.InsertAll(*to_add)); // Re-adding same set no-ops.
147 EXPECT_EQ(4u, extensions.size()); 147 EXPECT_EQ(4u, extensions.size());
148 } 148 }
149 149
150 } // namespace extensions 150 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/quota_service_unittest.cc ('k') | extensions/common/features/simple_feature_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698