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

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..42e2db02a04bcf7343cda4cdcb5643019358f058
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-pause.html
@@ -0,0 +1,58 @@
+<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 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);
+ }
+
+ var width;
+ function saveWidth(result)
+ {
+ width = result;
+ // Allow some frames to be painted to ensure it stays paused.
+ setTimeout(InspectorTest.evaluateInPage.bind(InspectorTest, "getWidth()", checkWidth), 50);
pfeldman 2015/10/21 22:53:10 timeout is in most cases a source of the flake. th
samli 2015/10/21 22:54:21 That it is indeed truly paused.
pfeldman 2015/10/26 18:20:50 But 50 gives you nothing, it could result in 0 or
samli 2015/10/26 18:30:49 If its correctly paused, it doesn't matter if I me
+ }
+
+ function checkWidth(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