Index: sky/viewer/internals.cc |
diff --git a/sky/viewer/internals.cc b/sky/viewer/internals.cc |
index a4831eeb032f7b29eed4a3095ee4dcd0fa270421..0288b9cc30d296a29a1f2fc1121100dd524c6f6d 100644 |
--- a/sky/viewer/internals.cc |
+++ b/sky/viewer/internals.cc |
@@ -9,6 +9,7 @@ |
#include "mojo/edk/js/support.h" |
#include "mojo/public/cpp/application/connect.h" |
#include "mojo/public/interfaces/application/shell.mojom.h" |
+#include "sky/engine/public/web/WebDocument.h" |
#include "sky/engine/public/web/WebFrame.h" |
#include "sky/engine/public/web/WebView.h" |
#include "sky/viewer/document_view.h" |
@@ -46,7 +47,8 @@ gin::ObjectTemplateBuilder Internals::GetObjectTemplateBuilder( |
.SetMethod("renderTreeAsText", &Internals::RenderTreeAsText) |
.SetMethod("contentAsText", &Internals::ContentAsText) |
.SetMethod("notifyTestComplete", &Internals::NotifyTestComplete) |
- .SetMethod("connectToService", &Internals::ConnectToService); |
+ .SetMethod("connectToService", &Internals::ConnectToService) |
+ .SetMethod("pauseAnimations", &Internals::pauseAnimations); |
} |
std::string Internals::RenderTreeAsText() { |
@@ -80,4 +82,11 @@ mojo::Handle Internals::ConnectToService( |
return pipe.handle0.release(); |
} |
+void Internals::pauseAnimations(double pauseTime) { |
+ if (pauseTime < 0) |
+ return; |
+ |
+ document_view_->web_view()->mainFrame()->document().pauseAnimationsForTesting(pauseTime); |
+} |
+ |
} // namespace sky |