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

Unified Diff: chrome/test/data/webui/test_api.js

Issue 1060973004: Enable tests related to the extensions web ui that were flaky. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Apply feedback Created 5 years, 7 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
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..a88cf8ade4679d0e0ccee7c014d481c913d35c5c 100644
--- a/chrome/test/data/webui/test_api.js
+++ b/chrome/test/data/webui/test_api.js
@@ -44,6 +44,24 @@ var testing = {};
*/
function Test() {};
+ /**
+ * Make all transitions and animations take 0ms. NOTE: this will completely
+ * disable webkitTransitionEnd events. If your code relies on them firing, it
+ * will break. webkitAnimationEnd events should still work.
+ */
+ 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 +324,12 @@ var testing = {};
* @type {Function}
*/
tearDown: function() {
+ if (typeof document != 'undefined') {
+ var noAnimationStyle = document.getElementById('no-animation');
+ if (noAnimationStyle)
+ noAnimationStyle.parentNode.removeChild(noAnimationStyle);
+ }
+
Mock4JS.verifyAllMocks();
},
« no previous file with comments | « chrome/test/data/webui/print_preview.js ('k') | tools/valgrind/gtest_exclude/browser_tests.gtest-drmemory_win32.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698