| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 CONTENT_SHELL_RENDERER_LAYOUT_TEST_LAYOUT_TEST_RENDER_THREAD_OBSERVER_H_ | 5 #ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_LAYOUT_TEST_RENDER_THREAD_OBSERVER_H_ |
| 6 #define CONTENT_SHELL_RENDERER_LAYOUT_TEST_LAYOUT_TEST_RENDER_THREAD_OBSERVER_H_ | 6 #define CONTENT_SHELL_RENDERER_LAYOUT_TEST_LAYOUT_TEST_RENDER_THREAD_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "content/public/renderer/render_thread_observer.h" | 13 #include "content/public/renderer/render_thread_observer.h" |
| 14 #include "ipc/ipc_platform_file.h" | 14 #include "ipc/ipc_platform_file.h" |
| 15 | 15 |
| 16 namespace base { | 16 namespace base { |
| 17 class DictionaryValue; | 17 class DictionaryValue; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace blink { | 20 namespace blink { |
| 21 class WebFrame; | 21 class WebFrame; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace test_runner { | 24 namespace test_runner { |
| 25 class WebTestDelegate; | |
| 26 class WebTestInterfaces; | 25 class WebTestInterfaces; |
| 27 } | 26 } |
| 28 | 27 |
| 29 namespace content { | 28 namespace content { |
| 30 | 29 |
| 31 class LayoutTestRenderThreadObserver : public RenderThreadObserver { | 30 class LayoutTestRenderThreadObserver : public RenderThreadObserver { |
| 32 public: | 31 public: |
| 33 static LayoutTestRenderThreadObserver* GetInstance(); | 32 static LayoutTestRenderThreadObserver* GetInstance(); |
| 34 | 33 |
| 35 LayoutTestRenderThreadObserver(); | 34 LayoutTestRenderThreadObserver(); |
| 36 ~LayoutTestRenderThreadObserver() override; | 35 ~LayoutTestRenderThreadObserver() override; |
| 37 | 36 |
| 38 void SetTestDelegate(test_runner::WebTestDelegate* delegate); | |
| 39 | |
| 40 // RenderThreadObserver implementation. | 37 // RenderThreadObserver implementation. |
| 41 void OnRenderProcessShutdown() override; | 38 void OnRenderProcessShutdown() override; |
| 42 bool OnControlMessageReceived(const IPC::Message& message) override; | 39 bool OnControlMessageReceived(const IPC::Message& message) override; |
| 43 | 40 |
| 44 test_runner::WebTestDelegate* test_delegate() const { | |
| 45 return test_delegate_; | |
| 46 } | |
| 47 test_runner::WebTestInterfaces* test_interfaces() const { | 41 test_runner::WebTestInterfaces* test_interfaces() const { |
| 48 return test_interfaces_.get(); | 42 return test_interfaces_.get(); |
| 49 } | 43 } |
| 50 const base::FilePath& webkit_source_dir() const { return webkit_source_dir_; } | 44 const base::FilePath& webkit_source_dir() const { return webkit_source_dir_; } |
| 51 | 45 |
| 52 private: | 46 private: |
| 53 // Message handlers. | 47 // Message handlers. |
| 54 void OnSetWebKitSourceDir(const base::FilePath& webkit_source_dir); | 48 void OnSetWebKitSourceDir(const base::FilePath& webkit_source_dir); |
| 55 void OnReplicateLayoutTestRuntimeFlagsChanges( | 49 void OnReplicateLayoutTestRuntimeFlagsChanges( |
| 56 const base::DictionaryValue& changed_layout_test_runtime_flags); | 50 const base::DictionaryValue& changed_layout_test_runtime_flags); |
| 57 | 51 |
| 58 test_runner::WebTestDelegate* test_delegate_; | |
| 59 std::unique_ptr<test_runner::WebTestInterfaces> test_interfaces_; | 52 std::unique_ptr<test_runner::WebTestInterfaces> test_interfaces_; |
| 60 | 53 |
| 61 base::FilePath webkit_source_dir_; | 54 base::FilePath webkit_source_dir_; |
| 62 | 55 |
| 63 DISALLOW_COPY_AND_ASSIGN(LayoutTestRenderThreadObserver); | 56 DISALLOW_COPY_AND_ASSIGN(LayoutTestRenderThreadObserver); |
| 64 }; | 57 }; |
| 65 | 58 |
| 66 } // namespace content | 59 } // namespace content |
| 67 | 60 |
| 68 #endif // CONTENT_SHELL_RENDERER_LAYOUT_TEST_LAYOUT_TEST_RENDER_THREAD_OBSERVER
_H_ | 61 #endif // CONTENT_SHELL_RENDERER_LAYOUT_TEST_LAYOUT_TEST_RENDER_THREAD_OBSERVER
_H_ |
| OLD | NEW |