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

Unified Diff: LayoutTests/animations/interpolation/resources/interpolation-test.js

Issue 1022723002: Remove unused interpolation reftest functionality (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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 | LayoutTests/animations/interpolation/sample-interpolation-reftest.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/animations/interpolation/resources/interpolation-test.js
diff --git a/LayoutTests/animations/interpolation/resources/interpolation-test.js b/LayoutTests/animations/interpolation/resources/interpolation-test.js
index 1d36570f9d99700f0d06686a088d575d5e5e805f..6189b70baeda1bbe834033708e040f02ba231ae8 100644
--- a/LayoutTests/animations/interpolation/resources/interpolation-test.js
+++ b/LayoutTests/animations/interpolation/resources/interpolation-test.js
@@ -33,26 +33,16 @@
* exercise the interpolation functionaltiy of the animation system.
* Tests which run using this script should be portable across browsers.
*
- * The following functions are exported:
- * * runAsRefTest - indicates that the test is a ref test and disables
- * dumping of textual output.
- * * testInterpolationAt([timeFractions], {property: x, from: y, to: z})
- * Constructs a test case for the interpolation of property x from
- * value y to value z at each of the times in timeFractions.
+ * The following function is exported:
* * assertInterpolation({property: x, from: y, to: z}, [{at: fraction, is: value}])
* Constructs a test case which for each fraction will output a PASS
* or FAIL depending on whether the interpolated result matches
* 'value'. Replica elements are constructed to aid eyeballing test
* results. This function may not be used in a ref test.
- * * convertToReference - This is intended to be used interactively to
- * construct a reference given the results of a test. To build a
- * reference, run the test, open the inspector and trigger this
- * function, then copy/paste the results.
*/
'use strict';
(function() {
var webkitPrefix = 'webkitAnimation' in document.documentElement.style ? '-webkit-' : '';
- var isRefTest = false;
var webAnimationsTest = typeof Element.prototype.animate === 'function';
var startEvent = webkitPrefix ? 'webkitAnimationStart' : 'animationstart';
var endEvent = webkitPrefix ? 'webkitAnimationEnd' : 'animationend';
@@ -106,51 +96,25 @@
function dumpResults() {
var targets = document.querySelectorAll('.target.active');
- if (isRefTest) {
- // Convert back to reference to avoid cases where the computed style is
- // out of sync with the compositor.
- for (var i = 0; i < targets.length; i++) {
- targets[i].convertToReference();
+ var cssResultString = 'CSS Animations:\n';
+ var waResultString = 'Web Animations API:\n';
+ for (var i = 0; i < targets.length; i++) {
+ if (targets[i].testType === 'css') {
+ cssResultString += targets[i].getResultString() + '\n';
+ } else {
+ waResultString += targets[i].getResultString() + '\n';
}
- style.parentNode.removeChild(style);
- } else {
- var cssResultString = 'CSS Animations:\n';
- var waResultString = 'Web Animations API:\n';
- for (var i = 0; i < targets.length; i++) {
- if (targets[i].testType === 'css') {
- cssResultString += targets[i].getResultString() + '\n';
- } else {
- waResultString += targets[i].getResultString() + '\n';
- }
- }
- var results = document.createElement('pre');
- results.textContent = cssResultString + (waTestsDiv ? '\n' + waResultString : '');
- results.id = 'results';
- document.body.appendChild(results);
- }
- }
-
- function convertToReference() {
- console.assert(isRefTest);
- var scripts = document.querySelectorAll('script');
- for (var i = 0; i < scripts.length; i++) {
- scripts[i].parentNode.removeChild(scripts[i]);
}
- style.parentNode.removeChild(style);
- var html = document.documentElement.outerHTML;
- document.documentElement.style.whiteSpace = 'pre';
- document.documentElement.textContent = html;
+ var results = document.createElement('pre');
+ results.textContent = cssResultString + (waTestsDiv ? '\n' + waResultString : '');
+ results.id = 'results';
+ document.body.appendChild(results);
}
function afterTest(callback) {
afterTestCallback = callback;
}
- function runAsRefTest() {
- console.assert(!isRefTest);
- isRefTest = true;
- }
-
// Constructs a timing function which produces 'y' at x = 0.5
function createEasing(y) {
// FIXME: if 'y' is > 0 and < 1 use a linear timing function and allow
@@ -290,7 +254,6 @@
}
function makeInterpolationTest(testType, fraction, testId, caseId, params, expectation) {
- console.assert(expectation === undefined || !isRefTest);
var targetContainer = createTargetContainer(caseId);
var target = targetContainer.querySelector('.target') || targetContainer;
target.classList.add('active');
@@ -322,9 +285,6 @@
'[' + params.to + '] was [' + value + ']' +
' at ' + fraction + reason;
};
- target.convertToReference = function() {
- this.style[params.property] = getComputedStyle(this).getPropertyValue(params.property);
- };
var easing = createEasing(fraction);
testCount++;
if (testType === 'css') {
@@ -364,12 +324,10 @@
afterTestCallback();
}
if (window.testRunner) {
- if (!isRefTest) {
- var results = document.querySelector('#results');
- document.documentElement.textContent = '';
- document.documentElement.appendChild(results);
- testRunner.dumpAsText();
- }
+ var results = document.querySelector('#results');
+ document.documentElement.textContent = '';
+ document.documentElement.appendChild(results);
+ testRunner.dumpAsText();
testRunner.notifyDone();
}
}
@@ -421,10 +379,8 @@
webAnimationsTest = false;
}
- window.runAsRefTest = runAsRefTest;
window.testInterpolationAt = testInterpolationAt;
window.assertInterpolation = assertInterpolation;
- window.convertToReference = convertToReference;
window.afterTest = afterTest;
window.disableWebAnimationsTest = disableWebAnimationsTest;
})();
« no previous file with comments | « no previous file | LayoutTests/animations/interpolation/sample-interpolation-reftest.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698