Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1239)

Unified Diff: android_webview/browser/browser_view_renderer_unittest.cc

Issue 1002013003: Unit Test for WebView animating in and out of screen (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « android_webview/browser/browser_view_renderer.cc ('k') | android_webview/browser/test/fake_window.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « android_webview/browser/browser_view_renderer.cc ('k') | android_webview/browser/test/fake_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698