OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef EXTENSIONS_RENDERER_MODULE_SYSTEM_TEST_H_ | 5 #ifndef EXTENSIONS_RENDERER_MODULE_SYSTEM_TEST_H_ |
6 #define EXTENSIONS_RENDERER_MODULE_SYSTEM_TEST_H_ | 6 #define EXTENSIONS_RENDERER_MODULE_SYSTEM_TEST_H_ |
7 | 7 |
8 #include "extensions/renderer/module_system.h" | 8 #include "extensions/renderer/module_system.h" |
9 #include "extensions/renderer/script_context.h" | 9 #include "extensions/renderer/script_context.h" |
10 #include "gin/public/context_holder.h" | 10 #include "gin/public/context_holder.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 // to use it to handle any requireNative() calls for native modules with that | 31 // to use it to handle any requireNative() calls for native modules with that |
32 // name. | 32 // name. |
33 void OverrideNativeHandler(const std::string& name, const std::string& code); | 33 void OverrideNativeHandler(const std::string& name, const std::string& code); |
34 | 34 |
35 // Registers |file_name| from chrome/test/data/extensions as a module name | 35 // Registers |file_name| from chrome/test/data/extensions as a module name |
36 // |module_name|. | 36 // |module_name|. |
37 void RegisterTestFile(const std::string& module_name, | 37 void RegisterTestFile(const std::string& module_name, |
38 const std::string& file_name); | 38 const std::string& file_name); |
39 | 39 |
40 // Create an empty object in the global scope with name |name|. | 40 // Create an empty object in the global scope with name |name|. |
41 v8::Handle<v8::Object> CreateGlobal(const std::string& name); | 41 v8::Local<v8::Object> CreateGlobal(const std::string& name); |
42 | 42 |
43 void ShutdownGin(); | 43 void ShutdownGin(); |
44 | 44 |
45 void ShutdownModuleSystem(); | 45 void ShutdownModuleSystem(); |
46 | 46 |
47 ModuleSystem* module_system() { return context_->module_system(); } | 47 ModuleSystem* module_system() { return context_->module_system(); } |
48 | 48 |
49 ScriptContext* context() { return context_.get(); } | 49 ScriptContext* context() { return context_.get(); } |
50 | 50 |
51 v8::Isolate* isolate() { return isolate_; } | 51 v8::Isolate* isolate() { return isolate_; } |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 scoped_ptr<ModuleSystemTestEnvironment> env_; | 101 scoped_ptr<ModuleSystemTestEnvironment> env_; |
102 bool should_assertions_be_made_; | 102 bool should_assertions_be_made_; |
103 | 103 |
104 private: | 104 private: |
105 DISALLOW_COPY_AND_ASSIGN(ModuleSystemTest); | 105 DISALLOW_COPY_AND_ASSIGN(ModuleSystemTest); |
106 }; | 106 }; |
107 | 107 |
108 } // namespace extensions | 108 } // namespace extensions |
109 | 109 |
110 #endif // EXTENSIONS_RENDERER_MODULE_SYSTEM_TEST_H_ | 110 #endif // EXTENSIONS_RENDERER_MODULE_SYSTEM_TEST_H_ |
OLD | NEW |