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

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-pause.html

Issue 1417173002: Devtools Animations: Pause button based on groups not global (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months 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
Index: third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-pause.html
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-pause.html b/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-pause.html
new file mode 100644
index 0000000000000000000000000000000000000000..c168b0b2bec0a63ff3ac47b8b43350ffbb3ff8f0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-pause.html
@@ -0,0 +1,63 @@
+<html>
+<head>
+<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
+<script>
+
+var animation;
+
+function startAnimation()
+{
+ animation = node.animate([{ width: "100px" }, { width: "200px" }], 2000);
+}
+
+function getWidth()
+{
+ return node.offsetWidth;
+}
+
+function rafWidth(resolve, reject)
+{
+ function frameCallback()
+ {
+ resolve(node.offsetWidth);
+ }
+
+ requestAnimationFrame(frameCallback);
+}
+
+window.debugTest = true;
+function test()
+{
+ InspectorTest.eventHandler["Animation.animationStarted"] = onStarted;
+ InspectorTest.sendCommand("Animation.enable", {});
+ InspectorTest.evaluateInPage("startAnimation()", function() {});
+
+ function onStarted(response)
+ {
+ InspectorTest.log("Animation started");
+ InspectorTest.evaluateInPage("logPaused()");
+ InspectorTest.sendCommand("Animation.setPaused", { animations: [ response.params.animation.id ], paused: true }, animPaused);
+ }
+
+ function animPaused()
+ {
+ InspectorTest.evaluateInPage("getWidth()", saveWidth);
+ }
+
+ function saveWidth(nodeWidth)
+ {
+ var width = nodeWidth;
+ InspectorTest.invokePageFunctionPromise("rafWidth", []).then(function(result) {
+ InspectorTest.log(result === width);
+ InspectorTest.completeTest();
+ });
+ }
+}
+
+</script>
+</head>
+<body onload="runTest()">
+ Tests that the animation is correctly paused.
+ <div id="node" style="background-color: red; height: 100px"></div>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698