Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / android_webview / browser / test / rendering_test.h
blob1e212b794b16628a599180f8ec62153d7aa9b77a
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
3 // found in the LICENSE file.
5 #ifndef ANDROID_WEBVIEW_BROWSER_TEST_RENDERING_TEST_H_
6 #define ANDROID_WEBVIEW_BROWSER_TEST_RENDERING_TEST_H_
8 #include "android_webview/browser/browser_view_renderer_client.h"
9 #include "android_webview/browser/test/fake_window.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/single_thread_task_runner.h"
12 #include "testing/gtest/include/gtest/gtest.h"
14 namespace base {
15 class MessageLoop;
18 namespace content {
19 class TestSynchronousCompositor;
22 namespace android_webview {
24 class BrowserViewRenderer;
25 class FakeWindow;
26 struct ParentCompositorDrawConstraints;
28 class RenderingTest : public testing::Test,
29 public BrowserViewRendererClient,
30 public WindowHooks {
31 public:
32 // BrowserViewRendererClient overrides.
33 bool RequestDrawGL(bool wait_for_completion) override;
34 void OnNewPicture() override;
35 void PostInvalidate() override;
36 void DetachFunctorFromView() override;
37 gfx::Point GetLocationOnScreen() override;
38 void ScrollContainerViewTo(gfx::Vector2d new_value) override {}
39 bool IsSmoothScrollingActive() const override;
40 void UpdateScrollState(gfx::Vector2d max_scroll_offset,
41 gfx::SizeF contents_size_dip,
42 float page_scale_factor,
43 float min_page_scale_factor,
44 float max_page_scale_factor) override {}
45 void DidOverscroll(gfx::Vector2d overscroll_delta,
46 gfx::Vector2dF overscroll_velocity) override {}
47 void ParentDrawConstraintsUpdated(
48 const ParentCompositorDrawConstraints& draw_constraints) override {}
49 // WindowHooks overrides.
50 void WillOnDraw() override {}
51 void DidOnDraw(bool success) override {}
52 void WillSyncOnRT(SharedRendererState* functor) override {}
53 void DidSyncOnRT(SharedRendererState* functor) override {}
54 void WillProcessOnRT(SharedRendererState* functor) override {}
55 void DidProcessOnRT(SharedRendererState* functor) override {}
56 bool WillDrawOnRT(SharedRendererState* functor,
57 AwDrawGLInfo* draw_info) override;
58 void DidDrawOnRT(SharedRendererState* functor) override {}
60 protected:
61 RenderingTest();
62 ~RenderingTest() override;
64 virtual void SetUpTestHarness();
65 virtual void StartTest();
67 void RunTest();
68 void InitializeCompositor();
69 void Attach();
70 void EndTest();
72 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
73 scoped_ptr<BrowserViewRenderer> browser_view_renderer_;
74 scoped_ptr<content::TestSynchronousCompositor> compositor_;
75 scoped_ptr<FakeWindow> window_;
77 private:
78 void QuitMessageLoop();
80 const scoped_ptr<base::MessageLoop> message_loop_;
82 DISALLOW_COPY_AND_ASSIGN(RenderingTest);
85 #define RENDERING_TEST_F(TEST_FIXTURE_NAME) \
86 TEST_F(TEST_FIXTURE_NAME, RunTest) { RunTest(); } \
87 class NeedsSemicolon##TEST_FIXTURE_NAME {}
89 } // namespace android_webview
91 #endif // ANDROID_WEBVIEW_BROWSER_TEST_RENDERING_TEST_H_