OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |