| Index: android_webview/browser/browser_view_renderer_unittest.cc
|
| diff --git a/android_webview/browser/browser_view_renderer_unittest.cc b/android_webview/browser/browser_view_renderer_unittest.cc
|
| index e4c6eac5e89705cc4493d1b4216aa04079fa7983..634e1f3390e9a4f377b0597293d88de861d09cd1 100644
|
| --- a/android_webview/browser/browser_view_renderer_unittest.cc
|
| +++ b/android_webview/browser/browser_view_renderer_unittest.cc
|
| @@ -9,13 +9,7 @@
|
| namespace android_webview {
|
|
|
| class SmokeTest : public RenderingTest {
|
| - void StartTest() override {
|
| - browser_view_renderer_->SetContinuousInvalidate(true);
|
| - }
|
| -
|
| - void WillOnDraw() override {
|
| - browser_view_renderer_->SetContinuousInvalidate(false);
|
| - }
|
| + void StartTest() override { browser_view_renderer_->PostInvalidate(); }
|
|
|
| void DidDrawOnRT(SharedRendererState* functor) override {
|
| EndTest();
|
| @@ -26,25 +20,20 @@ RENDERING_TEST_F(SmokeTest);
|
|
|
| class ClearViewTest : public RenderingTest {
|
| public:
|
| - ClearViewTest() : on_draw_count_(0u) {}
|
| + ClearViewTest() : on_draw_count_(0) {}
|
|
|
| void StartTest() override {
|
| - browser_view_renderer_->SetContinuousInvalidate(true);
|
| + browser_view_renderer_->PostInvalidate();
|
| browser_view_renderer_->ClearView();
|
| }
|
|
|
| - void WillOnDraw() override {
|
| - on_draw_count_++;
|
| - if (on_draw_count_ == 2u) {
|
| - browser_view_renderer_->SetContinuousInvalidate(false);
|
| - }
|
| - }
|
| -
|
| void DidOnDraw(bool success) override {
|
| - if (on_draw_count_ == 1u) {
|
| + on_draw_count_++;
|
| + if (on_draw_count_ == 1) {
|
| // First OnDraw should be skipped due to ClearView.
|
| EXPECT_FALSE(success);
|
| browser_view_renderer_->DidUpdateContent(); // Unset ClearView.
|
| + browser_view_renderer_->PostInvalidate();
|
| } else {
|
| // Following OnDraws should succeed.
|
| EXPECT_TRUE(success);
|
| @@ -55,25 +44,23 @@ class ClearViewTest : public RenderingTest {
|
| EndTest();
|
| }
|
| private:
|
| - size_t on_draw_count_;
|
| + int on_draw_count_;
|
| };
|
|
|
| RENDERING_TEST_F(ClearViewTest);
|
|
|
| class TestAnimateInAndOutOfScreen : public RenderingTest {
|
| public:
|
| - TestAnimateInAndOutOfScreen()
|
| - : on_draw_count_(0u), draw_gl_count_on_rt_(0u) {}
|
| + TestAnimateInAndOutOfScreen() : on_draw_count_(0), draw_gl_count_on_rt_(0) {}
|
|
|
| void StartTest() override {
|
| new_constraints_ = ParentCompositorDrawConstraints(
|
| false, gfx::Transform(), gfx::Rect(window_->surface_size()));
|
| new_constraints_.transform.Scale(2.0, 2.0);
|
| - browser_view_renderer_->SetContinuousInvalidate(true);
|
| + browser_view_renderer_->PostInvalidate();
|
| }
|
|
|
| void WillOnDraw() override {
|
| - browser_view_renderer_->SetContinuousInvalidate(false);
|
| // Step 0: A single onDraw on screen. The parent draw constraints
|
| // of the BVR will updated to be the initial constraints.
|
| // Step 1: A single onDrraw off screen. The parent draw constraints of the
|
| @@ -81,7 +68,7 @@ class TestAnimateInAndOutOfScreen : public RenderingTest {
|
| // Step 2: This onDraw is to introduce the DrawGL that animates the
|
| // webview onto the screen on render thread. End the test when the parent
|
| // draw constraints of BVR is updated to initial constraints.
|
| - if (on_draw_count_ == 1u || on_draw_count_ == 2u)
|
| + if (on_draw_count_ == 1 || on_draw_count_ == 2)
|
| browser_view_renderer_->PrepareToDraw(gfx::Vector2d(), gfx::Rect());
|
| }
|
|
|
| @@ -92,7 +79,7 @@ class TestAnimateInAndOutOfScreen : public RenderingTest {
|
|
|
| bool WillDrawOnRT(SharedRendererState* functor,
|
| AwDrawGLInfo* draw_info) override {
|
| - if (draw_gl_count_on_rt_ == 1u) {
|
| + if (draw_gl_count_on_rt_ == 1) {
|
| draw_gl_count_on_rt_++;
|
| ui_proxy_->PostTask(FROM_HERE, base::Bind(&RenderingTest::PostInvalidate,
|
| base::Unretained(this)));
|
| @@ -104,7 +91,7 @@ class TestAnimateInAndOutOfScreen : public RenderingTest {
|
| draw_info->is_layer = false;
|
|
|
| gfx::Transform transform;
|
| - if (draw_gl_count_on_rt_ == 0u)
|
| + if (draw_gl_count_on_rt_ == 0)
|
| transform = new_constraints_.transform;
|
|
|
| transform.matrix().asColMajorf(draw_info->transform);
|
| @@ -145,8 +132,8 @@ class TestAnimateInAndOutOfScreen : public RenderingTest {
|
| }
|
|
|
| private:
|
| - size_t on_draw_count_;
|
| - size_t draw_gl_count_on_rt_;
|
| + int on_draw_count_;
|
| + int draw_gl_count_on_rt_;
|
| ParentCompositorDrawConstraints initial_constraints_;
|
| ParentCompositorDrawConstraints new_constraints_;
|
| };
|
|
|