Chromium Code Reviews| Index: content/shell/renderer/test_runner/web_test_proxy.cc |
| diff --git a/content/shell/renderer/test_runner/web_test_proxy.cc b/content/shell/renderer/test_runner/web_test_proxy.cc |
| index 983c864de63e11ac90444219d6c8c377dd1f7606..cf1f033471d349ccbe615e110599212c9e1f94a4 100644 |
| --- a/content/shell/renderer/test_runner/web_test_proxy.cc |
| +++ b/content/shell/renderer/test_runner/web_test_proxy.cc |
| @@ -482,6 +482,11 @@ void WebTestProxyBase::SetAcceptLanguages(const std::string& accept_languages) { |
| void WebTestProxyBase::CopyImageAtAndCapturePixels( |
| int x, int y, const base::Callback<void(const SkBitmap&)>& callback) { |
| + // It may happen that there is a scheduled animation and |
| + // no rootGraphicsLayer yet. If so we would run it right now. Otherwise |
| + // isAcceleratedCompositingActive will return false; |
| + AnimateNow(); |
|
danakj
2014/09/18 15:33:41
I think we need to fix WebViewImpl/blink, not just
|
| + |
| DCHECK(web_widget_->isAcceleratedCompositingActive()); |
| DCHECK(!callback.is_null()); |
| uint64_t sequence_number = blink::Platform::current()->clipboard()-> |
| @@ -532,6 +537,11 @@ void WebTestProxyBase::CapturePixelsAsync( |
| const base::Callback<void(const SkBitmap&)>& callback) { |
| TRACE_EVENT0("shell", "WebTestProxyBase::CapturePixelsAsync"); |
| + // It may happen that there is a scheduled animation and |
| + // no rootGraphicsLayer yet. If so we would run it right now. Otherwise |
| + // isAcceleratedCompositingActive will return false; |
| + AnimateNow(); |
| + |
| DCHECK(web_widget_->isAcceleratedCompositingActive()); |
| DCHECK(!callback.is_null()); |
| @@ -564,6 +574,11 @@ void WebTestProxyBase::DidDisplayAsync(const base::Closure& callback, |
| void WebTestProxyBase::DisplayAsyncThen(const base::Closure& callback) { |
| TRACE_EVENT0("shell", "WebTestProxyBase::DisplayAsyncThen"); |
| + // It may happen that there is a scheduled animation and |
| + // no rootGraphicsLayer yet. If so we would run it right now. Otherwise |
| + // isAcceleratedCompositingActive will return false; |
| + AnimateNow(); |
| + |
| CHECK(web_widget_->isAcceleratedCompositingActive()); |
| CapturePixelsAsync(base::Bind( |
| &WebTestProxyBase::DidDisplayAsync, base::Unretained(this), callback)); |