| 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 "android_webview/browser/browser_view_renderer_client.h" | 8 #include "android_webview/browser/browser_view_renderer_client.h" |
| 9 #include "android_webview/browser/test/fake_window.h" | 9 #include "android_webview/browser/test/fake_window.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 class MessageLoop; | 16 class MessageLoop; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace cc { |
| 20 class CompositorFrame; |
| 21 } |
| 22 |
| 19 namespace content { | 23 namespace content { |
| 20 class TestSynchronousCompositor; | 24 class TestSynchronousCompositor; |
| 21 } | 25 } |
| 22 | 26 |
| 23 namespace android_webview { | 27 namespace android_webview { |
| 24 | 28 |
| 25 class BrowserViewRenderer; | 29 class BrowserViewRenderer; |
| 26 class FakeWindow; | 30 class FakeWindow; |
| 27 struct ParentCompositorDrawConstraints; | 31 struct ParentCompositorDrawConstraints; |
| 28 | 32 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 51 void DidOnDraw(bool success) override {} | 55 void DidOnDraw(bool success) override {} |
| 52 void WillSyncOnRT(SharedRendererState* functor) override {} | 56 void WillSyncOnRT(SharedRendererState* functor) override {} |
| 53 void DidSyncOnRT(SharedRendererState* functor) override {} | 57 void DidSyncOnRT(SharedRendererState* functor) override {} |
| 54 void WillProcessOnRT(SharedRendererState* functor) override {} | 58 void WillProcessOnRT(SharedRendererState* functor) override {} |
| 55 void DidProcessOnRT(SharedRendererState* functor) override {} | 59 void DidProcessOnRT(SharedRendererState* functor) override {} |
| 56 bool WillDrawOnRT(SharedRendererState* functor, | 60 bool WillDrawOnRT(SharedRendererState* functor, |
| 57 AwDrawGLInfo* draw_info) override; | 61 AwDrawGLInfo* draw_info) override; |
| 58 void DidDrawOnRT(SharedRendererState* functor) override {} | 62 void DidDrawOnRT(SharedRendererState* functor) override {} |
| 59 | 63 |
| 60 protected: | 64 protected: |
| 65 |
| 61 RenderingTest(); | 66 RenderingTest(); |
| 62 ~RenderingTest() override; | 67 ~RenderingTest() override; |
| 63 | 68 |
| 64 virtual void SetUpTestHarness(); | 69 virtual void SetUpTestHarness(); |
| 65 virtual void StartTest(); | 70 virtual void StartTest(); |
| 66 | 71 |
| 67 void RunTest(); | 72 void RunTest(); |
| 68 void InitializeCompositor(); | 73 void InitializeCompositor(); |
| 69 void Attach(); | 74 void Attach(); |
| 70 void EndTest(); | 75 void EndTest(); |
| 71 void SetCompositorFrame(); | 76 scoped_ptr<cc::CompositorFrame> ConstructEmptyFrame(); |
| 72 | 77 |
| 73 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | 78 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
| 74 scoped_ptr<BrowserViewRenderer> browser_view_renderer_; | 79 scoped_ptr<BrowserViewRenderer> browser_view_renderer_; |
| 75 scoped_ptr<content::TestSynchronousCompositor> compositor_; | 80 scoped_ptr<content::TestSynchronousCompositor> compositor_; |
| 76 scoped_ptr<FakeWindow> window_; | 81 scoped_ptr<FakeWindow> window_; |
| 77 | 82 |
| 78 private: | 83 private: |
| 79 void QuitMessageLoop(); | 84 void QuitMessageLoop(); |
| 80 | 85 |
| 81 const scoped_ptr<base::MessageLoop> message_loop_; | 86 const scoped_ptr<base::MessageLoop> message_loop_; |
| 82 | 87 |
| 83 DISALLOW_COPY_AND_ASSIGN(RenderingTest); | 88 DISALLOW_COPY_AND_ASSIGN(RenderingTest); |
| 84 }; | 89 }; |
| 85 | 90 |
| 86 #define RENDERING_TEST_F(TEST_FIXTURE_NAME) \ | 91 #define RENDERING_TEST_F(TEST_FIXTURE_NAME) \ |
| 87 TEST_F(TEST_FIXTURE_NAME, RunTest) { RunTest(); } \ | 92 TEST_F(TEST_FIXTURE_NAME, RunTest) { RunTest(); } \ |
| 88 class NeedsSemicolon##TEST_FIXTURE_NAME {} | 93 class NeedsSemicolon##TEST_FIXTURE_NAME {} |
| 89 | 94 |
| 90 } // namespace android_webview | 95 } // namespace android_webview |
| 91 | 96 |
| 92 #endif // ANDROID_WEBVIEW_BROWSER_TEST_RENDERING_TEST_H_ | 97 #endif // ANDROID_WEBVIEW_BROWSER_TEST_RENDERING_TEST_H_ |
| OLD | NEW |