Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / content / shell / renderer / test_runner / web_test_proxy.cc
index d76ae50..fbf4881 100644 (file)
@@ -87,7 +87,7 @@ class HostMethodTask : public WebMethodTask<WebTestProxyBase> {
   HostMethodTask(WebTestProxyBase* object, CallbackMethodType callback)
       : WebMethodTask<WebTestProxyBase>(object), callback_(callback) {}
 
-  virtual void RunIfValid() OVERRIDE { (object_->*callback_)(); }
+  void RunIfValid() override { (object_->*callback_)(); }
 
  private:
   CallbackMethodType callback_;
@@ -486,12 +486,6 @@ 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;
-  // TODO(enne): remove this: http://crbug.com/397321
-  AnimateNow();
-
   DCHECK(!callback.is_null());
   uint64_t sequence_number =  blink::Platform::current()->clipboard()->
       sequenceNumber(blink::WebClipboard::Buffer());
@@ -570,13 +564,6 @@ void CaptureCallback::didCompositeAndReadback(const SkBitmap& bitmap) {
 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;
-  // TODO(enne): remove this: http://crbug.com/397321
-  AnimateNow();
-
   DCHECK(!callback.is_null());
 
   if (test_interfaces_->GetTestRunner()->isPrinting()) {
@@ -622,13 +609,6 @@ 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;
-  // TODO(enne): remove this: http://crbug.com/397321
-  AnimateNow();
-
   CapturePixelsAsync(base::Bind(
       &WebTestProxyBase::DidDisplayAsync, base::Unretained(this), callback));
 }
@@ -689,6 +669,10 @@ void WebTestProxyBase::AnimateNow() {
     animate_scheduled_ = false;
     web_widget_->animate(0.0);
     web_widget_->layout();
+    if (blink::WebPagePopup* popup = web_widget_->pagePopup()) {
+      popup->animate(0.0);
+      popup->layout();
+    }
   }
 }