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

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

Issue 1586863002: Devtools Animation: Deflake animation test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-release.html
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-release.html b/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-release.html
index 7df3ce9970fa905a407239901c4032b771d6ef28..bebdab05602625bed673a686a1232723a4c24f72 100644
--- a/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-release.html
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-release.html
@@ -7,7 +7,7 @@ var animation;
function startAnimation()
{
- animation = node.animate([{ width: "100px" }, { width: "2000px" }], { duration: 20, fill: "forwards" });
+ animation = node.animate([{ width: "100px" }, { width: "2000px" }], { duration: 0, fill: "forwards" });
}
function cancelAnimation()
@@ -15,29 +15,21 @@ function cancelAnimation()
animation.cancel();
}
-function rafWidth(resolve, reject)
+function getWidth()
{
- function frameCallback()
- {
- resolve(node.offsetWidth);
- }
-
- if (window.testRunner)
- testRunner.layoutAndPaintAsyncThen(frameCallback);
+ return node.offsetWidth;
}
-window.debugTest = true;
function test()
{
InspectorTest.eventHandler["Animation.animationStarted"] = onStarted;
InspectorTest.sendCommand("Animation.enable", {});
InspectorTest.evaluateInPage("startAnimation()", function() {});
- var pausedWidth;
function onStarted(response)
{
InspectorTest.log("Animation started");
- InspectorTest.invokePageFunctionPromise("rafWidth", []).then(pause.bind(null, response.params.animation.id));
+ InspectorTest.evaluateInPage("getWidth()", pause.bind(null, response.params.animation.id));
}
function pause(id, width)
@@ -45,7 +37,7 @@ function test()
InspectorTest.log("Box is animating: " + (width != 100).toString());
InspectorTest.sendCommand("Animation.setPaused", { animations: [ id ], paused: true });
InspectorTest.evaluateInPage("cancelAnimation()", function() {});
- InspectorTest.invokePageFunctionPromise("rafWidth", []).then(release.bind(null, id));
+ InspectorTest.evaluateInPage("getWidth()", release.bind(null, id));
}
function release(id, width)
@@ -53,7 +45,7 @@ function test()
InspectorTest.log("Animation paused");
InspectorTest.log("Box is animating: " + (width != 100).toString());
InspectorTest.sendCommand("Animation.releaseAnimations", { animations: [ id ] });
- InspectorTest.invokePageFunctionPromise("rafWidth", []).then(released);
+ InspectorTest.evaluateInPage("getWidth()", released);
}
function released(width)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698