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

Side by Side Diff: LayoutTests/imported/csswg-test/css-shapes-1/spec-examples/support/spec-example-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 approxShapeTest(testId, linePrefix, epsilon, lineOffsets) {
2 var isPositioned = { 'relative': true, 'fixed': true, 'absolute': true, 'sti cky': true },
3 loops = 0,
4 testDiv = document.getElementById(testId),
5 testOffset = isPositioned[getComputedStyle(testDiv).position] ? 0 : test Div.offsetLeft,
6 firstLine = document.getElementById(linePrefix + '0');
7
8 function runTest() {
9 if (firstLine.offsetLeft == testOffset) {
10 // wait for the shape image to load and layout to happen
11 if (loops > 100)
12 assert_unreached("Giving up waiting for shape layout to happen!" );
13 else
14 loops++;
15 window.setTimeout(runTest, 5);
16 return;
17 }
18
19 for (var i = 0; i < lineOffsets.length; i++) {
20 var line = document.getElementById(linePrefix + i);
21 assert_approx_equals(line.offsetLeft, lineOffsets[i] + testOffset, e psilon, 'Line ' + i + ' is positioned properly');
22 }
23 done();
24 }
25 runTest();
26 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698