| 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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/test/scoped_task_environment.h" |
| 9 #include "extensions/renderer/module_system.h" | 10 #include "extensions/renderer/module_system.h" |
| 10 #include "extensions/renderer/script_context.h" | 11 #include "extensions/renderer/script_context.h" |
| 11 #include "gin/public/context_holder.h" | 12 #include "gin/public/context_holder.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include "v8/include/v8.h" | 14 #include "v8/include/v8.h" |
| 14 | 15 |
| 15 namespace extensions { | 16 namespace extensions { |
| 16 class StringSourceMap; | 17 class StringSourceMap; |
| 17 | 18 |
| 18 class ModuleSystemTestEnvironment { | 19 class ModuleSystemTestEnvironment { |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 92 |
| 92 // Make the test fail if any asserts are called. By default a test will fail | 93 // Make the test fail if any asserts are called. By default a test will fail |
| 93 // if no asserts are called. | 94 // if no asserts are called. |
| 94 void ExpectNoAssertionsMade(); | 95 void ExpectNoAssertionsMade(); |
| 95 | 96 |
| 96 // Runs promises that have been resolved. Resolved promises will not run | 97 // Runs promises that have been resolved. Resolved promises will not run |
| 97 // until this is called. | 98 // until this is called. |
| 98 void RunResolvedPromises(); | 99 void RunResolvedPromises(); |
| 99 | 100 |
| 100 private: | 101 private: |
| 102 base::test::ScopedTaskEnvironment scoped_task_environment_; |
| 101 v8::Isolate* isolate_; | 103 v8::Isolate* isolate_; |
| 102 std::unique_ptr<ModuleSystemTestEnvironment> env_; | 104 std::unique_ptr<ModuleSystemTestEnvironment> env_; |
| 103 bool should_assertions_be_made_; | 105 bool should_assertions_be_made_; |
| 104 | 106 |
| 105 private: | 107 private: |
| 106 DISALLOW_COPY_AND_ASSIGN(ModuleSystemTest); | 108 DISALLOW_COPY_AND_ASSIGN(ModuleSystemTest); |
| 107 }; | 109 }; |
| 108 | 110 |
| 109 } // namespace extensions | 111 } // namespace extensions |
| 110 | 112 |
| 111 #endif // EXTENSIONS_RENDERER_MODULE_SYSTEM_TEST_H_ | 113 #endif // EXTENSIONS_RENDERER_MODULE_SYSTEM_TEST_H_ |
| OLD | NEW |