| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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_API_BINDING_TEST_H_ | 5 #ifndef EXTENSIONS_RENDERER_API_BINDING_TEST_H_ |
| 6 #define EXTENSIONS_RENDERER_API_BINDING_TEST_H_ | 6 #define EXTENSIONS_RENDERER_API_BINDING_TEST_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
| 12 #include "base/test/scoped_async_task_scheduler.h" | |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 14 #include "v8/include/v8.h" | 13 #include "v8/include/v8.h" |
| 15 | 14 |
| 16 namespace gin { | 15 namespace gin { |
| 17 class ContextHolder; | 16 class ContextHolder; |
| 18 class IsolateHolder; | 17 class IsolateHolder; |
| 19 } | 18 } |
| 20 | 19 |
| 21 namespace extensions { | 20 namespace extensions { |
| 22 | 21 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 37 | 36 |
| 38 v8::Local<v8::Context> ContextLocal(); | 37 v8::Local<v8::Context> ContextLocal(); |
| 39 void DisposeContext(); | 38 void DisposeContext(); |
| 40 | 39 |
| 41 // Returns the associated isolate. Defined out-of-line to avoid the include | 40 // Returns the associated isolate. Defined out-of-line to avoid the include |
| 42 // for IsolateHolder in the header. | 41 // for IsolateHolder in the header. |
| 43 v8::Isolate* isolate(); | 42 v8::Isolate* isolate(); |
| 44 | 43 |
| 45 private: | 44 private: |
| 46 base::MessageLoop message_loop_; | 45 base::MessageLoop message_loop_; |
| 47 | |
| 48 // Required by gin::V8Platform::CallOnBackgroundThread(). Can't be a | |
| 49 // ScopedTaskScheduler because v8 synchronously waits for tasks to run. | |
| 50 base::test::ScopedAsyncTaskScheduler scoped_async_task_scheduler_; | |
| 51 | |
| 52 std::unique_ptr<gin::IsolateHolder> isolate_holder_; | 46 std::unique_ptr<gin::IsolateHolder> isolate_holder_; |
| 53 std::unique_ptr<gin::ContextHolder> context_holder_; | 47 std::unique_ptr<gin::ContextHolder> context_holder_; |
| 54 | 48 |
| 55 DISALLOW_COPY_AND_ASSIGN(APIBindingTest); | 49 DISALLOW_COPY_AND_ASSIGN(APIBindingTest); |
| 56 }; | 50 }; |
| 57 | 51 |
| 58 } // namespace extensions | 52 } // namespace extensions |
| 59 | 53 |
| 60 #endif // EXTENSIONS_RENDERER_API_BINDING_TEST_H_ | 54 #endif // EXTENSIONS_RENDERER_API_BINDING_TEST_H_ |
| OLD | NEW |