test_v8_extension_configuration.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright 2016 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef EXTENSIONS_RENDERER_TEST_V8_EXTENSION_CONFIGURATION_H_
  5. #define EXTENSIONS_RENDERER_TEST_V8_EXTENSION_CONFIGURATION_H_
  6. #include <memory>
  7. #include <vector>
  8. namespace v8 {
  9. class Extension;
  10. class ExtensionConfiguration;
  11. }
  12. namespace extensions {
  13. // A test helper to allow for the instantiation of the SafeBuiltins
  14. // v8::Extension, which is needed by most/all of our custom bindings.
  15. class TestV8ExtensionConfiguration {
  16. public:
  17. TestV8ExtensionConfiguration();
  18. TestV8ExtensionConfiguration(const TestV8ExtensionConfiguration&) = delete;
  19. TestV8ExtensionConfiguration& operator=(const TestV8ExtensionConfiguration&) =
  20. delete;
  21. ~TestV8ExtensionConfiguration();
  22. static v8::ExtensionConfiguration* GetConfiguration();
  23. private:
  24. const char* v8_extension_name_;
  25. std::unique_ptr<v8::ExtensionConfiguration> v8_extension_configuration_;
  26. };
  27. } // namespace extensions
  28. #endif // EXTENSIONS_RENDERER_TEST_V8_EXTENSION_CONFIGURATION_H_