| 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> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "android_webview/browser/browser_view_renderer_client.h" | 10 #include "android_webview/browser/browser_view_renderer_client.h" |
| 11 #include "android_webview/browser/render_thread_manager_client.h" | 11 #include "android_webview/browser/render_thread_manager_client.h" |
| 12 #include "android_webview/browser/test/fake_window.h" | 12 #include "android_webview/browser/test/fake_window.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/run_loop.h" |
| 14 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
| 15 #include "cc/resources/resource.h" | 16 #include "cc/resources/resource.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 17 | 18 |
| 18 namespace base { | 19 namespace base { |
| 19 class MessageLoop; | 20 class MessageLoop; |
| 20 } | 21 } |
| 21 | 22 |
| 22 namespace cc { | 23 namespace cc { |
| 23 class CompositorFrame; | 24 class CompositorFrame; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 std::unique_ptr<cc::CompositorFrame> ConstructEmptyFrame(); | 91 std::unique_ptr<cc::CompositorFrame> ConstructEmptyFrame(); |
| 91 std::unique_ptr<cc::CompositorFrame> ConstructFrame( | 92 std::unique_ptr<cc::CompositorFrame> ConstructFrame( |
| 92 cc::ResourceId resource_id); | 93 cc::ResourceId resource_id); |
| 93 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | 94 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
| 94 std::unique_ptr<FakeWindow> window_; | 95 std::unique_ptr<FakeWindow> window_; |
| 95 std::unique_ptr<FakeFunctor> functor_; | 96 std::unique_ptr<FakeFunctor> functor_; |
| 96 std::unique_ptr<BrowserViewRenderer> browser_view_renderer_; | 97 std::unique_ptr<BrowserViewRenderer> browser_view_renderer_; |
| 97 std::unique_ptr<content::TestSynchronousCompositor> compositor_; | 98 std::unique_ptr<content::TestSynchronousCompositor> compositor_; |
| 98 | 99 |
| 99 private: | 100 private: |
| 100 void QuitMessageLoop(); | |
| 101 | |
| 102 void DrawGL(AwDrawGLInfo* aw_draw_gl_info); | 101 void DrawGL(AwDrawGLInfo* aw_draw_gl_info); |
| 103 | 102 |
| 104 const std::unique_ptr<base::MessageLoop> message_loop_; | 103 const std::unique_ptr<base::MessageLoop> message_loop_; |
| 104 base::RunLoop run_loop_; |
| 105 | 105 |
| 106 DISALLOW_COPY_AND_ASSIGN(RenderingTest); | 106 DISALLOW_COPY_AND_ASSIGN(RenderingTest); |
| 107 }; | 107 }; |
| 108 | 108 |
| 109 #define RENDERING_TEST_F(TEST_FIXTURE_NAME) \ | 109 #define RENDERING_TEST_F(TEST_FIXTURE_NAME) \ |
| 110 TEST_F(TEST_FIXTURE_NAME, RunTest) { RunTest(); } \ | 110 TEST_F(TEST_FIXTURE_NAME, RunTest) { RunTest(); } \ |
| 111 class NeedsSemicolon##TEST_FIXTURE_NAME {} | 111 class NeedsSemicolon##TEST_FIXTURE_NAME {} |
| 112 | 112 |
| 113 } // namespace android_webview | 113 } // namespace android_webview |
| 114 | 114 |
| 115 #endif // ANDROID_WEBVIEW_BROWSER_TEST_RENDERING_TEST_H_ | 115 #endif // ANDROID_WEBVIEW_BROWSER_TEST_RENDERING_TEST_H_ |
| OLD | NEW |