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

Unified Diff: sky/viewer/internals.cc

Issue 760183003: Enable/Unprefix Animations & Transitions, add basic tests (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: patch for landing Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/viewer/internals.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « sky/viewer/internals.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698