| Index: third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-start-cancel.js
|
| diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-start-cancel.html b/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-start-cancel.js
|
| similarity index 21%
|
| rename from third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-start-cancel.html
|
| rename to third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-start-cancel.js
|
| index 01aba78cba8dc3cb6af908f0b79d8ab34080cb15..151f8e6d0b959a107b9eb060a32d55ea21ed0316 100644
|
| --- a/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-start-cancel.html
|
| +++ b/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-start-cancel.js
|
| @@ -1,51 +1,27 @@
|
| -<html>
|
| -<head>
|
| -<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
|
| -<script>
|
| +(async function() {
|
| + let {page, session, Protocol} = await InspectorTest.startHTML(`
|
| + <div id='node' style='background-color: red; width: 100px'></div>
|
| + `, '');
|
|
|
| -function triggerEmptyTransition()
|
| -{
|
| - node.style.transition = "1s";
|
| + Protocol.Animation.onAnimationCreated(() => InspectorTest.log('Animation created'));
|
| + Protocol.Animation.onAnimationStarted(() => InspectorTest.log('Animation started'));
|
| + Protocol.Animation.onAnimationCanceled(() => {
|
| + InspectorTest.log('Animation canceled')
|
| + InspectorTest.completeTest();
|
| + });
|
| + Protocol.Animation.enable();
|
| +
|
| + session.evaluate(`
|
| + node.style.transition = '1s';
|
| node.offsetTop;
|
| - node.style.width = "200px";
|
| + node.style.width = '200px';
|
| node.offsetTop;
|
| // Deliberately delay for two RAFs, which causes the animation to start
|
| // before we cancel it by clearing the transition.
|
| window.requestAnimationFrame(function() {
|
| window.requestAnimationFrame(function() {
|
| - node.style.transition = "";
|
| + node.style.transition = '';
|
| });
|
| });
|
| -}
|
| -
|
| -function test()
|
| -{
|
| - InspectorTest.eventHandler["Animation.animationCreated"] = onCreated;
|
| - InspectorTest.eventHandler["Animation.animationStarted"] = onStarted;
|
| - InspectorTest.eventHandler["Animation.animationCanceled"] = onCanceled;
|
| - InspectorTest.sendCommand("Animation.enable", {});
|
| - InspectorTest.evaluateInPage("triggerEmptyTransition()", function() {});
|
| -
|
| - function onCreated()
|
| - {
|
| - InspectorTest.log("Animation created");
|
| - }
|
| -
|
| - function onStarted()
|
| - {
|
| - InspectorTest.log("Animation started");
|
| - }
|
| -
|
| - function onCanceled()
|
| - {
|
| - InspectorTest.log("Animation canceled");
|
| - InspectorTest.completeTest();
|
| - }
|
| -}
|
| -
|
| -</script>
|
| -</head>
|
| -<body onload="runTest()">
|
| - <div id="node" style="background-color: red; width: 100px"></div>
|
| -</body>
|
| -</html>
|
| + `);
|
| +})();
|
|
|