Commit ad35b686 authored by rniwa@webkit.org's avatar rniwa@webkit.org

Use testRunner instead of layoutTestController in animations tests

https://bugs.webkit.org/show_bug.cgi?id=88757

Reviewed by Tony Chang.

* animations/3d/change-transform-in-end-event.html:
* animations/3d/replace-filling-transform.html:
* animations/3d/state-at-end-event-transform.html:
* animations/3d/transform-origin-vs-functions.html:
* animations/animation-add-events-in-handler.html:
* animations/animation-border-overflow.html:
* animations/animation-controller-drt-api.html:
* animations/animation-direction-reverse-fill-mode-hardware.html:
* animations/animation-direction-reverse-fill-mode.html:
* animations/animation-drt-api-multiple-keyframes.html:
* animations/animation-drt-api.html:
* animations/animation-end-event-destroy-renderer.html:
* animations/animation-end-event-short-iterations.html:
* animations/animation-hit-test-transform.html:
* animations/animation-hit-test.html:
* animations/animation-iteration-event-destroy-renderer.html:
* animations/animation-matrix-negative-scale-unmatrix.html:
* animations/animation-on-inline-crash.html:
* animations/animation-shorthand-overriding.html:
* animations/animation-shorthand-removed.html:
* animations/animation-shorthand.html:
* animations/animation-start-event-destroy-renderer.html:
* animations/animation-welcome-safari.html:
* animations/body-removal-crash.html:
* animations/change-keyframes-name.html:
* animations/change-transform-style-during-animation.html:
* animations/combo-transform-translate+scale.html:
* animations/empty-keyframes.html:
* animations/fill-mode-forwards.html:
* animations/fill-mode-iteration-count-non-integer.html:
* animations/fill-mode-missing-from-to-keyframes.html:
* animations/fill-mode-multiple-keyframes.html:
* animations/fill-mode-removed.html:
* animations/fill-mode-reverse.html:
* animations/fill-mode-transform.html:
* animations/fill-mode.html:
* animations/fill-unset-properties.html:
* animations/font-size-using-ems.html-disabled:
* animations/import-crash.html:
* animations/keyframe-timing-functions-transform.html:
* animations/keyframe-timing-functions2.html:
* animations/keyframes-iteration-count-non-integer.html:
* animations/longhand-timing-function.html:
* animations/missing-from-to-transforms.html:
* animations/missing-from-to.html:
* animations/pause-crash.html:
* animations/resources/animation-test-helpers.js:
(checkExpectedValue):
(endTest):
* animations/state-at-end-event.html:
* animations/suspend-resume-animation-events.html:
* animations/suspend-transform-animation.html:
* animations/transition-and-animation-3.html:
* animations/unanimated-style.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119985 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2299fe09
2012-06-11 Ryosuke Niwa <rniwa@webkit.org>
Use testRunner instead of layoutTestController in animations tests
https://bugs.webkit.org/show_bug.cgi?id=88757
Reviewed by Tony Chang.
* animations/3d/change-transform-in-end-event.html:
* animations/3d/replace-filling-transform.html:
* animations/3d/state-at-end-event-transform.html:
* animations/3d/transform-origin-vs-functions.html:
* animations/animation-add-events-in-handler.html:
* animations/animation-border-overflow.html:
* animations/animation-controller-drt-api.html:
* animations/animation-direction-reverse-fill-mode-hardware.html:
* animations/animation-direction-reverse-fill-mode.html:
* animations/animation-drt-api-multiple-keyframes.html:
* animations/animation-drt-api.html:
* animations/animation-end-event-destroy-renderer.html:
* animations/animation-end-event-short-iterations.html:
* animations/animation-hit-test-transform.html:
* animations/animation-hit-test.html:
* animations/animation-iteration-event-destroy-renderer.html:
* animations/animation-matrix-negative-scale-unmatrix.html:
* animations/animation-on-inline-crash.html:
* animations/animation-shorthand-overriding.html:
* animations/animation-shorthand-removed.html:
* animations/animation-shorthand.html:
* animations/animation-start-event-destroy-renderer.html:
* animations/animation-welcome-safari.html:
* animations/body-removal-crash.html:
* animations/change-keyframes-name.html:
* animations/change-transform-style-during-animation.html:
* animations/combo-transform-translate+scale.html:
* animations/empty-keyframes.html:
* animations/fill-mode-forwards.html:
* animations/fill-mode-iteration-count-non-integer.html:
* animations/fill-mode-missing-from-to-keyframes.html:
* animations/fill-mode-multiple-keyframes.html:
* animations/fill-mode-removed.html:
* animations/fill-mode-reverse.html:
* animations/fill-mode-transform.html:
* animations/fill-mode.html:
* animations/fill-unset-properties.html:
* animations/font-size-using-ems.html-disabled:
* animations/import-crash.html:
* animations/keyframe-timing-functions-transform.html:
* animations/keyframe-timing-functions2.html:
* animations/keyframes-iteration-count-non-integer.html:
* animations/longhand-timing-function.html:
* animations/missing-from-to-transforms.html:
* animations/missing-from-to.html:
* animations/pause-crash.html:
* animations/resources/animation-test-helpers.js:
(checkExpectedValue):
(endTest):
* animations/state-at-end-event.html:
* animations/suspend-resume-animation-events.html:
* animations/suspend-transform-animation.html:
* animations/transition-and-animation-3.html:
* animations/unanimated-style.html:
2012-06-11 David Barr <davidbarr@chromium.org>
Add css3-images image-resolution (dppx only)
......
......@@ -46,14 +46,14 @@
function testEnded()
{
document.getElementById('tester').style.webkitTransform = 'translateX(150px)';
if (window.layoutTestController)
layoutTestController.notifyDone();
if (window.testRunner)
testRunner.notifyDone();
}
function startTest()
{
if (window.layoutTestController)
layoutTestController.waitUntilDone();
if (window.testRunner)
testRunner.waitUntilDone();
document.getElementById('tester').addEventListener('webkitAnimationEnd', testEnded, false);
document.getElementById('container').className = 'moved';
......
......@@ -56,8 +56,8 @@
else
result.innerHTML = "FAIL - final state was " + computedValue + " expected " + expectedValue;
if (window.layoutTestController)
layoutTestController.notifyDone();
if (window.testRunner)
testRunner.notifyDone();
}
function swapAnim()
......@@ -76,9 +76,9 @@
document.addEventListener("webkitAnimationEnd", swapAnim, false);
}
if (window.layoutTestController) {
layoutTestController.dumpAsText(true);
layoutTestController.waitUntilDone();
if (window.testRunner) {
testRunner.dumpAsText(true);
testRunner.waitUntilDone();
}
window.addEventListener("load", setup, false);
......
......@@ -42,14 +42,14 @@
function testEnded()
{
if (window.layoutTestController)
layoutTestController.notifyDone();
if (window.testRunner)
testRunner.notifyDone();
}
function startTest()
{
if (window.layoutTestController)
layoutTestController.waitUntilDone();
if (window.testRunner)
testRunner.waitUntilDone();
document.getElementById('tester').addEventListener('webkitAnimationEnd', testEnded, false);
document.getElementById('container').className = 'moved';
......
......@@ -55,9 +55,9 @@
</style>
<script type="text/javascript" charset="utf-8">
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
resultEntries = [];
......@@ -99,8 +99,8 @@
if (numSnapshots == 2) {
resultEntries.sort();
document.getElementById('result').innerHTML = resultEntries.join("");
if (window.layoutTestController)
layoutTestController.notifyDone();
if (window.testRunner)
testRunner.notifyDone();
}
}
......
<script>
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function touchElement(evt) {
......@@ -10,8 +10,8 @@ function touchElement(evt) {
total++;
if (total == 500) {
document.getElementById("results").innerHTML = "PASS: Adding animation events in the handler did not crash.";
if (window.layoutTestController)
layoutTestController.notifyDone();
if (window.testRunner)
testRunner.notifyDone();
}
}
......
......@@ -19,8 +19,8 @@
</style>
<script src="resources/animation-test-helpers.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
if (window.layoutTestController)
layoutTestController.dumpAsText();
if (window.testRunner)
testRunner.dumpAsText();
const expectedValues = [
// [animation-name, time, element-id, property, expected-value, tolerance]
......
......@@ -50,7 +50,7 @@
function sample0() {
var expected = 4;
var current = layoutTestController.numberOfActiveAnimations();
var current = testRunner.numberOfActiveAnimations();
if (current == expected)
document.getElementById('result0').innerHTML = "Number of active animations at 0s is (" + current + ") as expected";
else
......@@ -59,19 +59,19 @@
function sample1() {
var expected = 4;
var current = layoutTestController.numberOfActiveAnimations();
var current = testRunner.numberOfActiveAnimations();
if (current == expected)
document.getElementById('result1').innerHTML = "Number of active animations at 1s is (" + current + ") as expected";
else
document.getElementById('result1').innerHTML = "Number of active animations at 1s is (" + current + ") but was expecting (" + expected + ")";
layoutTestController.notifyDone();
testRunner.notifyDone();
}
function startTest() {
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
var target = document.getElementById('target');
target.style.top = '200px';
......
......@@ -43,9 +43,9 @@
];
var result = "";
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function animationEnded(event) {
......@@ -68,8 +68,8 @@
}
document.getElementById('result').innerHTML = result;
if (window.layoutTestController)
layoutTestController.notifyDone();
if (window.testRunner)
testRunner.notifyDone();
}
window.onload = function () {
......
......@@ -56,9 +56,9 @@
];
var result = "";
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function animationEnded(event) {
......@@ -81,8 +81,8 @@
}
document.getElementById('result').innerHTML = result;
if (window.layoutTestController)
layoutTestController.notifyDone();
if (window.testRunner)
testRunner.notifyDone();
}
window.onload = function () {
......
......@@ -23,15 +23,15 @@
<script src="resources/animation-test-helpers.js"></script>
<script>
if (window.layoutTestController) {
layoutTestController.waitUntilDone();
layoutTestController.dumpAsText();
if (window.testRunner) {
testRunner.waitUntilDone();
testRunner.dumpAsText();
}
function animationStarted()
{
if (window.layoutTestController) {
var paused = layoutTestController.pauseAnimationAtTimeOnElementWithId("anim", 1, "target");
if (window.testRunner) {
var paused = testRunner.pauseAnimationAtTimeOnElementWithId("anim", 1, "target");
var result;
if (paused)
result = "PASS: correctly paused animation";
......@@ -39,7 +39,7 @@
result = "FAIL: failed to pause animation";
document.getElementById('results').innerText = result;
layoutTestController.notifyDone();
testRunner.notifyDone();
} else
document.getElementById('results').innerText = "This test requires DRT";
}
......
......@@ -25,15 +25,15 @@
<script src="resources/animation-test-helpers.js"></script>
<script>
if (window.layoutTestController) {
layoutTestController.waitUntilDone();
layoutTestController.dumpAsText();
if (window.testRunner) {
testRunner.waitUntilDone();
testRunner.dumpAsText();
}
function animationStarted()
{
if (window.layoutTestController) {
var paused = layoutTestController.pauseAnimationAtTimeOnElementWithId("bounce", 1.0, "target");
if (window.testRunner) {
var paused = testRunner.pauseAnimationAtTimeOnElementWithId("bounce", 1.0, "target");
var result = "";
if (paused)
result = "PASS: correctly paused animation";
......@@ -41,7 +41,7 @@
result = "FAIL: failed to pause animation";
document.getElementById('results').innerText = result;
layoutTestController.notifyDone();
testRunner.notifyDone();
} else
document.getElementById('results').innerText = "This test requires DRT";
}
......
......@@ -16,9 +16,9 @@
}
</style>
<script type="text/javascript" charset="utf-8">
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
var numDone = 0;
......@@ -31,8 +31,8 @@
document.getElementById('results').innerHTML = 'Did not crash, so PASSED';
if (window.layoutTestController)
layoutTestController.notifyDone();
if (window.testRunner)
testRunner.notifyDone();
}
}
......
......@@ -20,17 +20,17 @@
}
</style>
<script>
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
onload = function()
{
document.addEventListener('webkitAnimationEnd', function() {
document.getElementById('result').innerHTML = 'PASS: got webkitAnimationEnd event';
if (window.layoutTestController)
layoutTestController.notifyDone();
if (window.testRunner)
testRunner.notifyDone();
}, false);
// Animation begins once we append the DOM node to the document.
......
......@@ -53,12 +53,12 @@
function doTest()
{
if (window.layoutTestController) {
if (!layoutTestController.pauseAnimationAtTimeOnElementWithId("anim", 2.0, "target"))
if (window.testRunner) {
if (!testRunner.pauseAnimationAtTimeOnElementWithId("anim", 2.0, "target"))
throw("Transition is not running");
checkResults();
layoutTestController.notifyDone();
testRunner.notifyDone();
}
else {
window.setTimeout("checkResults()", 2000);
......@@ -67,9 +67,9 @@
function startTest()
{
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
document.getElementById("target").style.webkitAnimationName = "anim";
......
......@@ -53,12 +53,12 @@
function doTest()
{
if (window.layoutTestController) {
if (!layoutTestController.pauseAnimationAtTimeOnElementWithId("anim", 2.0, "target"))
if (window.testRunner) {
if (!testRunner.pauseAnimationAtTimeOnElementWithId("anim", 2.0, "target"))
throw("Transition is not running");
checkResults();
layoutTestController.notifyDone();
testRunner.notifyDone();
}
else {
window.setTimeout("checkResults()", 2000);
......@@ -67,9 +67,9 @@
function startTest()
{
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
document.getElementById("target").style.webkitAnimationName = "anim";
......
......@@ -17,9 +17,9 @@
}
</style>
<script type="text/javascript" charset="utf-8">
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
var numDone = 0;
......@@ -32,8 +32,8 @@
document.getElementById('results').innerHTML = 'Did not crash, so PASSED';
if (window.layoutTestController)
layoutTestController.notifyDone();
if (window.testRunner)
testRunner.notifyDone();
}
}
......
......@@ -22,9 +22,9 @@
}
</style>
<script type="text/javascript" charset="utf-8">
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
result = "PASS";
......@@ -39,8 +39,8 @@
result = "FAIL(scaleY was positive, expected to be negative)";
document.getElementById('result').innerHTML = result;
if (window.layoutTestController)
layoutTestController.notifyDone();
if (window.testRunner)
testRunner.notifyDone();
}
function startAnimation()
......
......@@ -9,16 +9,16 @@
}
</style>
<script type="text/javascript" charset="utf-8">
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function waitForAnimation()
{
window.setTimeout(function() {
if (window.layoutTestController)
layoutTestController.notifyDone();
if (window.testRunner)
testRunner.notifyDone();
}, 50);
}
window.addEventListener('load', waitForAnimation, false);
......
......@@ -29,8 +29,8 @@ div > div {
}
</style>
<script type="text/javascript" charset="utf-8">
if (window.layoutTestController)
layoutTestController.dumpAsText();
if (window.testRunner)
testRunner.dumpAsText();
const kProperties = [
"webkitAnimationName",
......
......@@ -11,9 +11,9 @@
@-webkit-keyframes anim1 { }
</style>
<script type="text/javascript" charset="utf-8">
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
const kProperties = [
......@@ -90,8 +90,8 @@
var results = document.getElementById('result');
results.innerHTML = resultsString;
if (window.layoutTestController)
layoutTestController.notifyDone();
if (window.testRunner)
testRunner.notifyDone();
}
window.addEventListener('load', start, false);
......
......@@ -41,8 +41,8 @@
@-webkit-keyframes anim2 { }
</style>
<script type="text/javascript" charset="utf-8">
if (window.layoutTestController)
layoutTestController.dumpAsText();
if (window.testRunner)
testRunner.dumpAsText();
const kProperties = [
"webkitAnimationName",
......
......@@ -16,9 +16,9 @@
}
</style>
<script type="text/javascript" charset="utf-8">
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
var numDone = 0;
......@@ -31,8 +31,8 @@
document.getElementById('results').innerHTML = 'Did not crash, so PASSED';
if (window.layoutTestController)
layoutTestController.notifyDone();
if (window.testRunner)
testRunner.notifyDone();
}
}
......
......@@ -94,9 +94,9 @@ body.go #blue {
</style>
<script type="text/javascript" charset="utf-8">
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
var animationStarted = false;
......@@ -116,8 +116,8 @@ body.go #blue {
}, false);
document.addEventListener("webkitAnimationEnd", function(event) {
if (window.layoutTestController)
layoutTestController.notifyDone();
if (window.testRunner)
testRunner.notifyDone();
}, false);