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 #include "android_webview/browser/browser_view_renderer.h"
6 #include "android_webview/browser/test/rendering_test.h"
8 namespace android_webview
{
10 class SmokeTest
: public RenderingTest
{
11 void StartTest() override
{
12 browser_view_renderer_
->SetContinuousInvalidate(true);
15 void WillOnDraw() override
{
16 browser_view_renderer_
->SetContinuousInvalidate(false);
19 void DidDrawOnRT(SharedRendererState
* functor
) override
{
24 RENDERING_TEST_F(SmokeTest
);
26 class ClearViewTest
: public RenderingTest
{
28 ClearViewTest() : on_draw_count_(0u) {}
30 void StartTest() override
{
31 browser_view_renderer_
->SetContinuousInvalidate(true);
32 browser_view_renderer_
->ClearView();
35 void WillOnDraw() override
{
37 if (on_draw_count_
== 2u) {
38 browser_view_renderer_
->SetContinuousInvalidate(false);
42 void DidOnDraw(bool success
) override
{
43 if (on_draw_count_
== 1u) {
44 // First OnDraw should be skipped due to ClearView.
45 EXPECT_FALSE(success
);
46 browser_view_renderer_
->DidUpdateContent(); // Unset ClearView.
48 // Following OnDraws should succeed.
53 void DidDrawOnRT(SharedRendererState
* functor
) override
{
57 size_t on_draw_count_
;
60 RENDERING_TEST_F(ClearViewTest
);
62 } // namespace android_webview