| 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 ANDROID_WEBVIEW_BROWSER_TEST_RENDERING_TEST_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_TEST_RENDERING_TEST_H_ |
| 6 #define ANDROID_WEBVIEW_BROWSER_TEST_RENDERING_TEST_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_TEST_RENDERING_TEST_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "android_webview/browser/browser_view_renderer_client.h" | 10 #include "android_webview/browser/browser_view_renderer_client.h" |
| 9 #include "android_webview/browser/shared_renderer_state_client.h" | 11 #include "android_webview/browser/shared_renderer_state_client.h" |
| 10 #include "android_webview/browser/test/fake_window.h" | 12 #include "android_webview/browser/test/fake_window.h" |
| 11 #include "base/macros.h" | 13 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 16 |
| 16 namespace base { | 17 namespace base { |
| 17 class MessageLoop; | 18 class MessageLoop; |
| 18 } | 19 } |
| 19 | 20 |
| 20 namespace cc { | 21 namespace cc { |
| 21 class CompositorFrame; | 22 class CompositorFrame; |
| 22 } | 23 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 RenderingTest(); | 71 RenderingTest(); |
| 71 ~RenderingTest() override; | 72 ~RenderingTest() override; |
| 72 | 73 |
| 73 virtual void SetUpTestHarness(); | 74 virtual void SetUpTestHarness(); |
| 74 virtual void StartTest(); | 75 virtual void StartTest(); |
| 75 | 76 |
| 76 void RunTest(); | 77 void RunTest(); |
| 77 void InitializeCompositor(); | 78 void InitializeCompositor(); |
| 78 void Attach(); | 79 void Attach(); |
| 79 void EndTest(); | 80 void EndTest(); |
| 80 scoped_ptr<cc::CompositorFrame> ConstructEmptyFrame(); | 81 std::unique_ptr<cc::CompositorFrame> ConstructEmptyFrame(); |
| 81 | 82 |
| 82 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | 83 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
| 83 scoped_ptr<SharedRendererState> shared_renderer_state_; | 84 std::unique_ptr<SharedRendererState> shared_renderer_state_; |
| 84 scoped_ptr<BrowserViewRenderer> browser_view_renderer_; | 85 std::unique_ptr<BrowserViewRenderer> browser_view_renderer_; |
| 85 scoped_ptr<content::TestSynchronousCompositor> compositor_; | 86 std::unique_ptr<content::TestSynchronousCompositor> compositor_; |
| 86 scoped_ptr<FakeWindow> window_; | 87 std::unique_ptr<FakeWindow> window_; |
| 87 | 88 |
| 88 private: | 89 private: |
| 89 void QuitMessageLoop(); | 90 void QuitMessageLoop(); |
| 90 | 91 |
| 91 const scoped_ptr<base::MessageLoop> message_loop_; | 92 const std::unique_ptr<base::MessageLoop> message_loop_; |
| 92 | 93 |
| 93 DISALLOW_COPY_AND_ASSIGN(RenderingTest); | 94 DISALLOW_COPY_AND_ASSIGN(RenderingTest); |
| 94 }; | 95 }; |
| 95 | 96 |
| 96 #define RENDERING_TEST_F(TEST_FIXTURE_NAME) \ | 97 #define RENDERING_TEST_F(TEST_FIXTURE_NAME) \ |
| 97 TEST_F(TEST_FIXTURE_NAME, RunTest) { RunTest(); } \ | 98 TEST_F(TEST_FIXTURE_NAME, RunTest) { RunTest(); } \ |
| 98 class NeedsSemicolon##TEST_FIXTURE_NAME {} | 99 class NeedsSemicolon##TEST_FIXTURE_NAME {} |
| 99 | 100 |
| 100 } // namespace android_webview | 101 } // namespace android_webview |
| 101 | 102 |
| 102 #endif // ANDROID_WEBVIEW_BROWSER_TEST_RENDERING_TEST_H_ | 103 #endif // ANDROID_WEBVIEW_BROWSER_TEST_RENDERING_TEST_H_ |
| OLD | NEW |