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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-readonly-inverse.html

Issue 2552743002: Geometry interfaces tests shouldn't compare double numbers without any tolerance (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-invert.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <script src="../../resources/testharness.js"></script> 2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script> 3 <script src="../../resources/testharnessreport.js"></script>
4 <script src="./resources/geometry-interfaces-test-helpers.js"></script> 4 <script src="./resources/geometry-interfaces-test-helpers.js"></script>
5 <script> 5 <script>
6 test(function() { 6 test(function() {
7 var matrix2d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6]); 7 var matrix2d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6]);
8 var inverse = matrix2d.inverse(); 8 var inverse = matrix2d.inverse();
9 assert_2d_matrix_equals(inverse, [-2, 1, 1.5, -0.5, 1, -2]); 9 assert_2d_matrix_equals(inverse, [-2, 1, 1.5, -0.5, 1, -2]);
10 }, "DOMMatrix inverse() - invertible - 2D matrix"); 10 }, "DOMMatrix inverse() - invertible - 2D matrix");
11 11
12 test(function() { 12 test(function() {
13 var matrix2d = new DOMMatrixReadOnly([1, 1, 1, 1, 1, 1]); 13 var matrix2d = new DOMMatrixReadOnly([1, 1, 1, 1, 1, 1]);
14 var inverse =matrix2d.inverse(); 14 var inverse =matrix2d.inverse();
15 //when non invertible matrix execute invert(), result matrix is not 2d. 15 //when non invertible matrix execute invert(), result matrix is not 2d.
16 assert_3d_matrix_equals(inverse, [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN]); 16 assert_3d_matrix_equals(inverse, [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN]);
17 }, "DOMMatrix inverse() - non-invertible - 2D matrix"); 17 }, "DOMMatrix inverse() - non-invertible - 2D matrix");
18 18
19 test(function() { 19 test(function() {
20 var matrix3d = new DOMMatrixReadOnly([10, 20, 30, 40, 40, 40, 30, 20, 10, 20, 40, 30, 20, 40, 50, 100]); 20 var matrix3d = new DOMMatrixReadOnly([10, 20, 30, 40, 40, 40, 30, 20, 10, 20, 40, 30, 20, 40, 50, 100]);
21 var inverse = matrix3d.inverse(); 21 var inverse = matrix3d.inverse();
22 assert_3d_matrix_equals(inverse, [-1.6, 0.05, 0.6, 0.45, 2.05, -0.025, -0.8, - 0.575, -0.4, 0, 0.2, 0.1, -0.3, 0, 0.1, 0.1]); 22 assert_matrix_almost_equals(inverse, new DOMMatrix([-1.6, 0.05, 0.6, 0.45, 2.0 5, -0.025, -0.8, -0.575, -0.4, 0, 0.2, 0.1, -0.3, 0, 0.1, 0.1]));
23 }, "DOMMatrix inverse() - invertible - 3D matrix"); 23 }, "DOMMatrix inverse() - invertible - 3D matrix");
24 24
25 test(function() { 25 test(function() {
26 var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1 3, 14, 15, 16]); 26 var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1 3, 14, 15, 16]);
27 var inverse = matrix3d.inverse(); 27 var inverse = matrix3d.inverse();
28 assert_3d_matrix_equals(inverse, [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN]); 28 assert_3d_matrix_equals(inverse, [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN]);
29 }, "DOMMatrix inverse() - non-invertible - 3D matrix"); 29 }, "DOMMatrix inverse() - non-invertible - 3D matrix");
30 </script> 30 </script>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-invert.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698