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

Unified Diff: extensions/browser/extension_registry_unittest.cc

Issue 110463003: Create extensions_test_support build target (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase extension_test_util Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/extension_test_util.cc ('k') | extensions/browser/test_management_policy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_registry_unittest.cc
diff --git a/extensions/browser/extension_registry_unittest.cc b/extensions/browser/extension_registry_unittest.cc
index 4243dea4f39fc0703500463f5f4d306d2ec0df64..15c08e20849069bf66b519f7be56c59f35320737 100644
--- a/extensions/browser/extension_registry_unittest.cc
+++ b/extensions/browser/extension_registry_unittest.cc
@@ -6,34 +6,22 @@
#include <string>
-#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
-#include "base/values.h"
#include "extensions/common/extension.h"
-#include "extensions/common/extension_builder.h"
-#include "extensions/common/value_builder.h"
+#include "extensions/common/test_util.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace extensions {
namespace {
-// Creates a very simple extension.
-scoped_refptr<Extension> CreateExtensionWithID(const std::string& id) {
- return ExtensionBuilder()
- .SetManifest(
- DictionaryBuilder().Set("name", "Echo").Set("version", "1.0"))
- .SetID(id)
- .Build();
-}
-
typedef testing::Test ExtensionRegistryTest;
TEST_F(ExtensionRegistryTest, FillAndClearRegistry) {
ExtensionRegistry registry;
- scoped_refptr<Extension> extension1 = CreateExtensionWithID("id1");
- scoped_refptr<Extension> extension2 = CreateExtensionWithID("id2");
- scoped_refptr<Extension> extension3 = CreateExtensionWithID("id3");
- scoped_refptr<Extension> extension4 = CreateExtensionWithID("id4");
+ scoped_refptr<Extension> extension1 = test_util::CreateExtensionWithID("id1");
+ scoped_refptr<Extension> extension2 = test_util::CreateExtensionWithID("id2");
+ scoped_refptr<Extension> extension3 = test_util::CreateExtensionWithID("id3");
+ scoped_refptr<Extension> extension4 = test_util::CreateExtensionWithID("id4");
// All the sets start empty.
EXPECT_EQ(0u, registry.enabled_extensions().size());
@@ -66,7 +54,7 @@ TEST_F(ExtensionRegistryTest, AddAndRemoveExtensionFromRegistry) {
ExtensionRegistry registry;
// Adding an extension works.
- scoped_refptr<Extension> extension = CreateExtensionWithID("id");
+ scoped_refptr<Extension> extension = test_util::CreateExtensionWithID("id");
EXPECT_TRUE(registry.AddEnabled(extension));
EXPECT_EQ(1u, registry.enabled_extensions().size());
@@ -85,7 +73,7 @@ TEST_F(ExtensionRegistryTest, AddAndRemoveExtensionFromRegistry) {
TEST_F(ExtensionRegistryTest, AddExtensionToRegistryTwice) {
ExtensionRegistry registry;
- scoped_refptr<Extension> extension = CreateExtensionWithID("id");
+ scoped_refptr<Extension> extension = test_util::CreateExtensionWithID("id");
// An extension can exist in two sets at once. It would be nice to eliminate
// this functionality, but some users of ExtensionRegistry need it.
« no previous file with comments | « chrome/common/extensions/extension_test_util.cc ('k') | extensions/browser/test_management_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698