OLD | NEW |
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 "base/file_path.h" | 5 #include "base/file_path.h" |
6 #include "base/logging.h" | 6 #include "base/logging.h" |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
11 #include "chrome/common/extensions/extension_set.h" | 11 #include "chrome/common/extensions/extension_set.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
| 14 using extensions::Extension; |
| 15 |
14 namespace { | 16 namespace { |
15 | 17 |
16 scoped_refptr<Extension> CreateTestExtension(const std::string& name, | 18 scoped_refptr<Extension> CreateTestExtension(const std::string& name, |
17 const std::string& launch_url, | 19 const std::string& launch_url, |
18 const std::string& extent) { | 20 const std::string& extent) { |
19 #if defined(OS_WIN) | 21 #if defined(OS_WIN) |
20 FilePath path(FILE_PATH_LITERAL("c:\\")); | 22 FilePath path(FILE_PATH_LITERAL("c:\\")); |
21 #else | 23 #else |
22 FilePath path(FILE_PATH_LITERAL("/")); | 24 FilePath path(FILE_PATH_LITERAL("/")); |
23 #endif | 25 #endif |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 to_add->Insert(ext5); | 127 to_add->Insert(ext5); |
126 to_add->Insert(ext6); | 128 to_add->Insert(ext6); |
127 | 129 |
128 ASSERT_TRUE(extensions.Contains(ext3->id())); | 130 ASSERT_TRUE(extensions.Contains(ext3->id())); |
129 ASSERT_TRUE(extensions.InsertAll(*to_add)); | 131 ASSERT_TRUE(extensions.InsertAll(*to_add)); |
130 EXPECT_EQ(4u, extensions.size()); | 132 EXPECT_EQ(4u, extensions.size()); |
131 | 133 |
132 ASSERT_FALSE(extensions.InsertAll(*to_add)); // Re-adding same set no-ops. | 134 ASSERT_FALSE(extensions.InsertAll(*to_add)); // Re-adding same set no-ops. |
133 EXPECT_EQ(4u, extensions.size()); | 135 EXPECT_EQ(4u, extensions.size()); |
134 } | 136 } |
OLD | NEW |