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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "android_webview/browser/browser_view_renderer.h" 5 #include "android_webview/browser/browser_view_renderer.h"
6 #include "android_webview/browser/test/rendering_test.h" 6 #include "android_webview/browser/test/rendering_test.h"
7 7
8 namespace android_webview { 8 namespace android_webview {
9 9
10 class SmokeTest : public RenderingTest { 10 class SmokeTest : public RenderingTest {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 void DidDrawOnRT(SharedRendererState* functor) override { 53 void DidDrawOnRT(SharedRendererState* functor) override {
54 EndTest(); 54 EndTest();
55 } 55 }
56 private: 56 private:
57 size_t on_draw_count_; 57 size_t on_draw_count_;
58 }; 58 };
59 59
60 RENDERING_TEST_F(ClearViewTest); 60 RENDERING_TEST_F(ClearViewTest);
61 61
62 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
63 public:
64 TestForceInvalidateWithEmptyGlobalVisibleRect() : on_draw_count_(0u) {}
65
66 void StartTest() override {
67 browser_view_renderer_->SetContinuousInvalidate(true);
68 }
69
70 void WillOnDraw() override {
71 on_draw_count_++;
72
73 // The second onDraw will be the result of a forced invalidation because
74 // an empty global visible rect was used in the first onDraw.
75 if (on_draw_count_ == 2u)
76 EndTest();
77
78 browser_view_renderer_->PrepareToDraw(gfx::Vector2d(), gfx::Rect());
79 browser_view_renderer_->SetContinuousInvalidate(false);
80 }
81
82 private:
83 size_t on_draw_count_;
84 };
85
86 RENDERING_TEST_F(TestForceInvalidateWithEmptyGlobalVisibleRect);
87
62 } // namespace android_webview 88 } // namespace android_webview
OLDNEW
« 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