 Chromium Code Reviews
 Chromium Code Reviews Issue 1002013003:
  Unit Test for WebView animating in and out of screen  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 1002013003:
  Unit Test for WebView animating in and out of screen  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| Index: android_webview/browser/test/fake_window.cc | 
| diff --git a/android_webview/browser/test/fake_window.cc b/android_webview/browser/test/fake_window.cc | 
| index 0a0956bab3a5316b7ea9e169edfae55ee7bdfad1..f87ae128c2630a79e2e894b28ac19efec7823323 100644 | 
| --- a/android_webview/browser/test/fake_window.cc | 
| +++ b/android_webview/browser/test/fake_window.cc | 
| @@ -5,7 +5,6 @@ | 
| #include "android_webview/browser/test/fake_window.h" | 
| #include "android_webview/browser/browser_view_renderer.h" | 
| -#include "android_webview/public/browser/draw_gl.h" | 
| #include "base/message_loop/message_loop_proxy.h" | 
| #include "base/synchronization/waitable_event.h" | 
| #include "base/threading/thread.h" | 
| @@ -119,8 +118,8 @@ void FakeWindow::OnDrawHardware() { | 
| DCHECK(on_draw_hardware_pending_); | 
| on_draw_hardware_pending_ = false; | 
| - hooks_->WillOnDraw(); | 
| view_->PrepareToDraw(gfx::Vector2d(), location_); | 
| + hooks_->WillOnDraw(); | 
| bool success = view_->OnDrawHardware(); | 
| hooks_->DidOnDraw(success); | 
| if (success) { | 
| @@ -147,7 +146,10 @@ void FakeWindow::DrawFunctorOnRT(base::WaitableEvent* sync) { | 
| functor_->DrawGL(&process_info); | 
| hooks_->DidSyncOnRT(functor_); | 
| } | 
| - sync->Signal(); | 
| + | 
| + if (!hooks_->WillWaitForModeDrawToFinish()) { | 
| + sync->Signal(); | 
| + } | 
| AwDrawGLInfo draw_info; | 
| draw_info.version = kAwDrawGLInfoVersion; | 
| @@ -156,36 +158,24 @@ void FakeWindow::DrawFunctorOnRT(base::WaitableEvent* sync) { | 
| draw_info.clip_top = location.y(); | 
| draw_info.clip_right = location.x() + location.width(); | 
| draw_info.clip_bottom = location.y() + location.height(); | 
| - draw_info.width = surface_size_.width(); | 
| - draw_info.height = surface_size_.height(); | 
| - draw_info.is_layer = false; | 
| - | 
| - draw_info.transform[0] = 1.0; | 
| - draw_info.transform[1] = 0.0; | 
| - draw_info.transform[2] = 0.0; | 
| - draw_info.transform[3] = 0.0; | 
| - | 
| - draw_info.transform[4] = 0.0; | 
| - draw_info.transform[5] = 1.0; | 
| - draw_info.transform[6] = 0.0; | 
| - draw_info.transform[7] = 0.0; | 
| - | 
| - draw_info.transform[8] = 0.0; | 
| - draw_info.transform[9] = 0.0; | 
| - draw_info.transform[10] = 1.0; | 
| - draw_info.transform[11] = 0.0; | 
| - | 
| - draw_info.transform[12] = 0.0; | 
| - draw_info.transform[13] = 0.0; | 
| - draw_info.transform[14] = 0.0; | 
| - draw_info.transform[15] = 1.0; | 
| - | 
| - hooks_->WillDrawOnRT(functor_); | 
| + | 
| + hooks_->SetParentDrawConstraints(draw_info); | 
| + | 
| + if (!hooks_->WillDrawOnRT(functor_)) { | 
| + if (hooks_->WillWaitForModeDrawToFinish()) { | 
| 
boliu
2015/03/13 23:51:55
Save the value from above. Don't call it twice.
M
 
hush (inactive)
2015/03/16 18:19:21
I put it as a private member in the class.
 | 
| + sync->Signal(); | 
| + } | 
| + return; | 
| + } | 
| + | 
| { | 
| ScopedMakeCurrent make_current(this); | 
| functor_->DrawGL(&draw_info); | 
| } | 
| hooks_->DidDrawOnRT(functor_); | 
| + if (hooks_->WillWaitForModeDrawToFinish()) { | 
| 
boliu
2015/03/13 23:51:55
ditto
 
hush (inactive)
2015/03/16 18:19:21
Done.
 | 
| + sync->Signal(); | 
| + } | 
| } | 
| void FakeWindow::CheckCurrentlyOnUIThread() { |