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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/components/geometry.html

Issue 1975723003: DevTools: fix janky transition in sensors panel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated test and rebase Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/components/geometry-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script> 3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script> 4 <script>
5 function test() 5 function test()
6 { 6 {
7 InspectorTest.runTestSuite([ 7 InspectorTest.runTestSuite([
8 8
9 function testVectorLength(next) 9 function testVectorLength(next)
10 { 10 {
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 new WebInspector.Geometry.Vector(-1, 1, 0), 97 new WebInspector.Geometry.Vector(-1, 1, 0),
98 new WebInspector.Geometry.Vector(0, 0, 0), 98 new WebInspector.Geometry.Vector(0, 0, 0),
99 ]; 99 ];
100 100
101 for (var i = 0; i < vectorsU.length; ++i) 101 for (var i = 0; i < vectorsU.length; ++i)
102 InspectorTest.addResult(String.sprintf("Calculate angle: %.4 f", WebInspector.Geometry.calculateAngle(vectorsU[i], vectorsV[i]))); 102 InspectorTest.addResult(String.sprintf("Calculate angle: %.4 f", WebInspector.Geometry.calculateAngle(vectorsU[i], vectorsV[i])));
103 103
104 next(); 104 next();
105 }, 105 },
106 106
107 function testRadToDeg(next) 107 function testRadiansToDegrees(next)
108 { 108 {
109 var angles = [Math.PI, Math.PI / 4, Math.PI / 6]; 109 var angles = [Math.PI, Math.PI / 4, Math.PI / 6];
110 for (var i = 0; i < angles.length; ++i) 110 for (var i = 0; i < angles.length; ++i)
111 InspectorTest.addResult(String.sprintf("deg: %.4f", WebInspe ctor.Geometry.radToDeg(angles[i]))); 111 InspectorTest.addResult(String.sprintf("deg: %.4f", WebInspe ctor.Geometry.radiansToDegrees(angles[i])));
112 112
113 next(); 113 next();
114 }, 114 },
115
116 function testDegreesToRadians(next)
117 {
118 var angles = [-30, 0, 30, 90, 180];
119 for (var i = 0; i < angles.length; ++i)
120 InspectorTest.addResult(String.sprintf("rad: %.4f", WebInspe ctor.Geometry.degreesToRadians(angles[i])));
121
122 next();
123 },
115 124
116 function testEulerAnglesFromRotationMatrix(next) 125 function testEulerAnglesFromRotationMatrix(next)
117 { 126 {
118 var rotationMatrices = [ 127 var rotationMatrices = [
119 "matrix3d(0.612, 0.353, -0.707, 0, 0.280, 0.739, 0.612, 0, 0 .739, -0.573, 0.353, 0, 0, 0, 0, 1)", 128 "matrix3d(0.612, 0.353, -0.707, 0, 0.280, 0.739, 0.612, 0, 0 .739, -0.573, 0.353, 0, 0, 0, 0, 1)",
120 129
121 "matrix3d(0.353, 0.612, -0.707, 0, -0.573, 0.739, 0.353, 0, 0.739, 0.280, 0.612, 0, 0, 0, 0, 1)", 130 "matrix3d(0.353, 0.612, -0.707, 0, -0.573, 0.739, 0.353, 0, 0.739, 0.280, 0.612, 0, 0, 0, 0, 1)",
122 131
123 "matrix3d(0.342, 0, -0.939, 0, 0.321, 0.939, 0.116, 0, 0.883 , -0.342, 0.321, 0, 0, 0, 0, 1)" 132 "matrix3d(0.342, 0, -0.939, 0, 0.321, 0.939, 0.116, 0, 0.883 , -0.342, 0.321, 0, 0, 0, 0, 1)"
124 ]; 133 ];
125 134
126 for (var i = 0; i < rotationMatrices.length; ++i) { 135 for (var i = 0; i < rotationMatrices.length; ++i) {
127 var angles = WebInspector.Geometry.EulerAngles.fromRotationM atrix(new WebKitCSSMatrix(rotationMatrices[i])); 136 var angles = WebInspector.Geometry.EulerAngles.fromRotationM atrix(new WebKitCSSMatrix(rotationMatrices[i]));
128 InspectorTest.addResult(String.sprintf("Euler angles: %.4f % .4f %.4f", angles.alpha, angles.beta, angles.gamma)); 137 InspectorTest.addResult(String.sprintf("Euler angles: %.4f % .4f %.4f", angles.alpha, angles.beta, angles.gamma));
129 } 138 }
130 next(); 139 next();
140 },
141
142 function testEulerAnglesToRotate3DString(next)
143 {
144 var angles = [
145 new WebInspector.Geometry.EulerAngles(0, 0, 0),
146 new WebInspector.Geometry.EulerAngles(1, 2, 3),
147 new WebInspector.Geometry.EulerAngles(-1, -2, 3),
148 new WebInspector.Geometry.EulerAngles(-1, 2, -3),
149 new WebInspector.Geometry.EulerAngles(0, 1, 2),
150 new WebInspector.Geometry.EulerAngles(1, 0, 2),
151 new WebInspector.Geometry.EulerAngles(1, 2, 0)
152 ];
153
154 for (var i = 0; i < angles.length; ++i) {
155 var rotate3DString = angles[i].toRotate3DString();
156 InspectorTest.addResult(String.sprintf("Transform: %s", rota te3DString));
157 }
158 next();
131 } 159 }
132 160
133 ]); 161 ]);
134 162
135 } 163 }
136 </script> 164 </script>
137 </head> 165 </head>
138 <body onload="runTest()"> 166 <body onload="runTest()">
139 <p>Tests Geometry utility class</p> 167 <p>Tests Geometry utility class</p>
140 </body> 168 </body>
141 </html> 169 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/components/geometry-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698