Chromium Code Reviews| Index: extensions/common/extension_api.h |
| diff --git a/extensions/common/extension_api.h b/extensions/common/extension_api.h |
| index e876079b37858897adf6611bcfe679e5744fed8a..2a232b8423fe4a1a265af2842687849b846d4a67 100644 |
| --- a/extensions/common/extension_api.h |
| +++ b/extensions/common/extension_api.h |
| @@ -65,14 +65,11 @@ class ExtensionAPI { |
| ExtensionAPI* original_api_; |
| }; |
| - // Creates a completely clean instance. Configure using RegisterSchema() and |
| + // Creates a completely clean instance. Configure using |
| // RegisterDependencyProvider before use. |
| ExtensionAPI(); |
| virtual ~ExtensionAPI(); |
| - // Add a (non-generated) API schema resource. |
| - void RegisterSchemaResource(const std::string& api_name, int resource_id); |
| - |
| // Add a FeatureProvider for APIs. The features are used to specify |
| // dependencies and constraints on the availability of APIs. |
| void RegisterDependencyProvider(const std::string& name, |
| @@ -126,6 +123,9 @@ class ExtensionAPI { |
| // Returns NULL if the feature could not be found. |
| Feature* GetFeatureDependency(const std::string& dependency_name); |
| + // Adds a fake schema that the ExtensionAPI should know about. |
| + void RegisterFakeSchemaForTesting(const std::string& schema); |
| + |
| private: |
| FRIEND_TEST_ALL_PREFIXES(ExtensionAPITest, DefaultConfigurationFeatures); |
| FRIEND_TEST_ALL_PREFIXES(ExtensionAPITest, TypesHaveNamespace); |
| @@ -138,10 +138,9 @@ class ExtensionAPI { |
| // Loads a schema. |
| void LoadSchema(const std::string& name, const base::StringPiece& schema); |
| - // Map from each API that hasn't been loaded yet to the schema which defines |
| - // it. Note that there may be multiple APIs per schema. |
| - typedef std::map<std::string, int> UnloadedSchemaMap; |
| - UnloadedSchemaMap unloaded_schemas_; |
| + // A set of fake schema resources that we should treat as knowing for testing. |
| + // TODO(devlin): This is rather silly. |
| + std::set<std::string> fake_schemas_; |
|
Devlin
2016/08/22 18:30:45
I don't love this, but I also don't have a better
lazyboy
2016/08/22 22:51:31
I would put them in TestExtensionAPI (extending fr
Devlin
2016/08/23 00:13:08
Works for me. Still not my favorite, but I think
|
| // Schemas for each namespace. |
| using SchemaMap = |