Chromium Code Reviews| 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 b4a9d42227241cef82d61d71a47608eb57d52001..6e9483a5676453e2fd70f5e45d7c8fd7c662186f 100644 |
| --- a/android_webview/browser/browser_view_renderer_unittest.cc |
| +++ b/android_webview/browser/browser_view_renderer_unittest.cc |
| @@ -59,4 +59,30 @@ class ClearViewTest : public RenderingTest { |
| RENDERING_TEST_F(ClearViewTest); |
| +class TestForceInvalidateWithEmptyGlobalVisibleRect : public RenderingTest { |
|
boliu
2015/03/12 22:54:01
Does this actually fail without the fix?
DrawGL s
hush (inactive)
2015/03/12 23:12:00
Yes, it fails without the fix. SharedRendererState
boliu
2015/03/12 23:16:39
Without this fix, I don't see how that returns fal
hush (inactive)
2015/03/12 23:44:28
Looks like you've found another bug in HardwareRen
boliu
2015/03/12 23:56:37
It's surprising what you find when you actually wr
|
| + public: |
| + TestForceInvalidateWithEmptyGlobalVisibleRect() : on_draw_count_(0u) {} |
| + |
| + void StartTest() override { |
| + browser_view_renderer_->SetContinuousInvalidate(true); |
| + } |
| + |
| + void WillOnDraw() override { |
| + on_draw_count_++; |
| + |
| + // The second onDraw will be the result of a forced invalidation because |
| + // an empty global visible rect was used in the first onDraw. |
| + if (on_draw_count_ == 2u) |
| + EndTest(); |
| + |
| + browser_view_renderer_->PrepareToDraw(gfx::Vector2d(), gfx::Rect()); |
| + browser_view_renderer_->SetContinuousInvalidate(false); |
| + } |
| + |
| + private: |
| + size_t on_draw_count_; |
| +}; |
| + |
| +RENDERING_TEST_F(TestForceInvalidateWithEmptyGlobalVisibleRect); |
| + |
| } // namespace android_webview |