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

Unified Diff: third_party/WebKit/LayoutTests/animations/resources/helpers.js

Issue 2582713002: CSS Animations: Fix flaky test transform-origin-vs-functions.html (Closed)
Patch Set: helpers.js Created 4 years 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 | « third_party/WebKit/LayoutTests/animations/3d/transform-origin-vs-functions-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/animations/resources/helpers.js
diff --git a/third_party/WebKit/LayoutTests/animations/resources/helpers.js b/third_party/WebKit/LayoutTests/animations/resources/helpers.js
new file mode 100644
index 0000000000000000000000000000000000000000..fb3c4af075c59aca4c8dc5367eae086b4c629916
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/animations/resources/helpers.js
@@ -0,0 +1,16 @@
+'use strict';
+
+function matricesApproxEqual(actualMatrix, expectedMatrix, epsilon) {
+ const actualNumbers = actualMatrix.split(/[\(\) ,]/);
+ const expectedNumbers = expectedMatrix.split(/[\(\) ,]/);
+ if (actualNumbers.length !== expectedNumbers.length) {
+ return false;
+ }
+ for (var i = 0; i < actualNumbers.length; i++) {
+ if (actualNumbers[i] !== expectedNumbers[i] &&
+ Math.abs(Number(actualNumbers[i]) - Number(expectedNumbers[i])) > epsilon) {
+ return false;
+ }
+ }
+ return true;
+}
« no previous file with comments | « third_party/WebKit/LayoutTests/animations/3d/transform-origin-vs-functions-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698