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

Side by Side Diff: LayoutTests/imported/csswg-test/css-shapes-1/shape-outside/supported-shapes/support/test-utils.js

Issue 816533002: Import CSSWG Shapes tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: One more test expectations update Created 6 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 function verifyTextPoints(shape, numLines, tolerance, side) {
2 var failed = false;
3 if (tolerance === undefined)
4 tolerance = 0.5;
5 if (side === undefined)
6 side = "left";
7
8 if (side === "right")
9 shape.roundedRect.x = shape.containerWidth - (shape.roundedRect.x + shap e.roundedRect.width);
10
11 var expected = getRoundedRectLeftEdge(shape);
12
13 for(var i = 0; i < numLines; i++) {
14 var line = document.getElementById('test'+i);
15 var actual = line.getBoundingClientRect().left;
16 if (side === "right")
17 actual = shape.containerWidth - (actual + line.getBoundingClientRect ().width);
18
19 if( Math.abs( (actual - expected[i])) > tolerance ){
20 line.style.setProperty('color', 'red');
21 console.log('diff: ' + Math.abs(actual - expected[i]));
22 failed = true;
23 }
24 }
25 if (window.done) {
26 assert_false(failed, "Lines positioned properly around the shape.");
27 done();
28 }
29 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698