Chromium Code Reviews| Index: chrome/test/data/webui/test_api.js |
| diff --git a/chrome/test/data/webui/test_api.js b/chrome/test/data/webui/test_api.js |
| index be8664310a231be58f9744c91e67ac0f509155e3..0bb0e7ebe7a47c21ac38e25977a88771c9c3865a 100644 |
| --- a/chrome/test/data/webui/test_api.js |
| +++ b/chrome/test/data/webui/test_api.js |
| @@ -44,6 +44,25 @@ var testing = {}; |
| */ |
| function Test() {}; |
| + /** |
| + * Make all transitions and animations take 0ms. |
| + * Any animations will still happen and webkitAnimationEnd should be |
| + * listened to. |
|
Dan Beam
2015/04/30 23:22:04
Make all transitions and animations take 0ms. NOTE
hcarmona
2015/05/01 16:51:31
Done.
|
| + * Transitions will not dispatch any webkitTransitionEnd events. |
| + */ |
| + Test.disableAnimationsAndTransitions = function() { |
| + var noAnimationStyle = document.createElement('style'); |
| + noAnimationStyle.id = 'no-animation'; |
| + noAnimationStyle.textContent = |
| + '* {' + |
| + ' -webkit-transition-duration: 0ms !important;' + |
| + ' -webkit-transition-delay: 0ms !important;' + |
| + ' -webkit-animation-duration: 0ms !important;' + |
| + ' -webkit-animation-delay: 0ms !important;' + |
| + '}'; |
| + document.querySelector('head').appendChild(noAnimationStyle); |
| + }; |
| + |
| Test.prototype = { |
| /** |
| * The name of the test. |
| @@ -306,6 +325,10 @@ var testing = {}; |
| * @type {Function} |
| */ |
| tearDown: function() { |
| + var noAnimationStyle = $('no-animation'); |
| + if (noAnimationStyle) |
| + noAnimationStyle.parentNode.removeChild(noAnimationStyle); |
| + |
| Mock4JS.verifyAllMocks(); |
| }, |