| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 | 190 |
| 191 function describeCSSTest(params) { | 191 function describeCSSTest(params) { |
| 192 return 'CSS ' + params.property + ': from [' + params.from + '] to [' + para
ms.to + ']'; | 192 return 'CSS ' + params.property + ': from [' + params.from + '] to [' + para
ms.to + ']'; |
| 193 } | 193 } |
| 194 | 194 |
| 195 function describeWATest(params) { | 195 function describeWATest(params) { |
| 196 return 'element.animate() ' + convertPropertyToCamelCase(params.property) +
': from [' + params.from + '] to [' + params.to + ']'; | 196 return 'element.animate() ' + convertPropertyToCamelCase(params.property) +
': from [' + params.from + '] to [' + params.to + ']'; |
| 197 } | 197 } |
| 198 | 198 |
| 199 function assertInterpolation(params, expectations) { | 199 function assertInterpolation(params, expectations) { |
| 200 // If the prefixed property is not supported, try to unprefix it. | |
| 201 if (/^-[^-]+-/.test(params.property) && !CSS.supports(params.property, 'init
ial')) { | |
| 202 var unprefixed = params.property.replace(/^-[^-]+-/, ''); | |
| 203 if (CSS.supports(unprefixed, 'initial')) { | |
| 204 params.property = unprefixed; | |
| 205 } | |
| 206 } | |
| 207 var testId = defineKeyframes(params); | 200 var testId = defineKeyframes(params); |
| 208 var nextCaseId = 0; | 201 var nextCaseId = 0; |
| 209 var cssTestContainer = createTestContainer(describeCSSTest(params), testId); | 202 var cssTestContainer = createTestContainer(describeCSSTest(params), testId); |
| 210 cssTests.appendChild(cssTestContainer); | 203 cssTests.appendChild(cssTestContainer); |
| 211 if (webAnimationsTest) { | 204 if (webAnimationsTest) { |
| 212 var waTestContainer = createTestContainer(describeWATest(params), testId); | 205 var waTestContainer = createTestContainer(describeWATest(params), testId); |
| 213 waTests.appendChild(waTestContainer); | 206 waTests.appendChild(waTestContainer); |
| 214 } | 207 } |
| 215 expectations.forEach(function(expectation) { | 208 expectations.forEach(function(expectation) { |
| 216 cssTestContainer.appendChild(makeInterpolationTest( | 209 cssTestContainer.appendChild(makeInterpolationTest( |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 finishTest(); | 413 finishTest(); |
| 421 }, 10000); | 414 }, 10000); |
| 422 } | 415 } |
| 423 | 416 |
| 424 window.runAsRefTest = runAsRefTest; | 417 window.runAsRefTest = runAsRefTest; |
| 425 window.testInterpolationAt = testInterpolationAt; | 418 window.testInterpolationAt = testInterpolationAt; |
| 426 window.assertInterpolation = assertInterpolation; | 419 window.assertInterpolation = assertInterpolation; |
| 427 window.convertToReference = convertToReference; | 420 window.convertToReference = convertToReference; |
| 428 window.afterTest = afterTest; | 421 window.afterTest = afterTest; |
| 429 })(); | 422 })(); |
| OLD | NEW |