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

Unified Diff: extensions/test/test_extensions_client.cc

Issue 2165023003: [Extensions] Use compiled feature files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 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 | « extensions/test/test_extensions_client.h ('k') | tools/json_schema_compiler/feature_compiler.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/test/test_extensions_client.cc
diff --git a/extensions/test/test_extensions_client.cc b/extensions/test/test_extensions_client.cc
index 025e1cd65485826bc27db4d6a3bac4d03fc43cba..e7c6d7cb6c769d82071b7321e449c7e778766206 100644
--- a/extensions/test/test_extensions_client.cc
+++ b/extensions/test/test_extensions_client.cc
@@ -19,6 +19,10 @@
#include "extensions/common/permissions/extensions_api_permissions.h"
#include "extensions/common/permissions/permissions_info.h"
#include "extensions/common/url_pattern_set.h"
+#include "extensions/test/test_api_features.h"
+#include "extensions/test/test_behavior_features.h"
+#include "extensions/test/test_manifest_features.h"
+#include "extensions/test/test_permission_features.h"
#include "extensions/test/test_permission_message_provider.h"
#include "grit/extensions_resources.h"
@@ -75,20 +79,14 @@ const std::string TestExtensionsClient::GetProductName() {
std::unique_ptr<FeatureProvider> TestExtensionsClient::CreateFeatureProvider(
const std::string& name) const {
std::unique_ptr<FeatureProvider> provider;
- std::unique_ptr<JSONFeatureProviderSource> source(
- CreateFeatureProviderSource(name));
if (name == "api") {
- provider.reset(new JSONFeatureProvider(source->dictionary(),
- CreateFeature<APIFeature>));
+ provider.reset(new TestAPIFeatureProvider());
} else if (name == "manifest") {
- provider.reset(new JSONFeatureProvider(source->dictionary(),
- CreateFeature<ManifestFeature>));
+ provider.reset(new TestManifestFeatureProvider());
} else if (name == "permission") {
- provider.reset(new JSONFeatureProvider(source->dictionary(),
- CreateFeature<PermissionFeature>));
+ provider.reset(new TestPermissionFeatureProvider());
} else if (name == "behavior") {
- provider.reset(new JSONFeatureProvider(source->dictionary(),
- CreateFeature<BehaviorFeature>));
+ provider.reset(new TestBehaviorFeatureProvider());
} else {
NOTREACHED();
}
@@ -96,22 +94,10 @@ std::unique_ptr<FeatureProvider> TestExtensionsClient::CreateFeatureProvider(
}
std::unique_ptr<JSONFeatureProviderSource>
-TestExtensionsClient::CreateFeatureProviderSource(
- const std::string& name) const {
+TestExtensionsClient::CreateAPIFeatureSource() const {
std::unique_ptr<JSONFeatureProviderSource> source(
- new JSONFeatureProviderSource(name));
- if (name == "api") {
- source->LoadJSON(IDR_EXTENSION_API_FEATURES);
- } else if (name == "manifest") {
- source->LoadJSON(IDR_EXTENSION_MANIFEST_FEATURES);
- } else if (name == "permission") {
- source->LoadJSON(IDR_EXTENSION_PERMISSION_FEATURES);
- } else if (name == "behavior") {
- source->LoadJSON(IDR_EXTENSION_BEHAVIOR_FEATURES);
- } else {
- NOTREACHED();
- source.reset();
- }
+ new JSONFeatureProviderSource("api"));
+ source->LoadJSON(IDR_EXTENSION_API_FEATURES);
return source;
}
« no previous file with comments | « extensions/test/test_extensions_client.h ('k') | tools/json_schema_compiler/feature_compiler.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698