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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/images/script-tests/border.js

Issue 2228333003: Use testharness.js in fast/images/ for border/cmyk tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code changed as per comments. Created 4 years, 4 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
OLDNEW
(Empty)
1 description(
2 "This tests the HTMLImageElement border property."
3 );
4
5 function imageBorderWidth(borderValue, style)
6 {
7 var image = document.createElement("img");
8 if (borderValue !== undefined)
9 image.setAttribute("border", borderValue);
10 image.setAttribute("style", style);
11 image.setAttribute("width", "0");
12 document.body.appendChild(image);
13 var borderBoxWidth = image.offsetWidth;
14 document.body.removeChild(image);
15 return borderBoxWidth / 2;
16 }
17
18 shouldBe("imageBorderWidth()", "0");
19 shouldBe("imageBorderWidth(null)", "0");
20 shouldBe("imageBorderWidth('')", "0");
21 shouldBe("imageBorderWidth(0)", "0");
22 shouldBe("imageBorderWidth('x')", "0");
23 shouldBe("imageBorderWidth(undefined, 'border-width: 20px')", "0");
24
25 shouldBe("imageBorderWidth(null, 'border-width: 20px')", "20");
26 shouldBe("imageBorderWidth('', 'border-width: 20px')", "20");
27 shouldBe("imageBorderWidth('x', 'border-width: 20px')", "20");
28 shouldBe("imageBorderWidth(0, 'border-width: 20px')", "20");
29
30 shouldBe("imageBorderWidth(10)", "10");
31 shouldBe("imageBorderWidth(' 10')", "10");
32 shouldBe("imageBorderWidth('10 ')", "10");
33 shouldBe("imageBorderWidth(' 10 ')", "10");
34 shouldBe("imageBorderWidth('10q')", "10");
35 shouldBe("imageBorderWidth(' 10q')", "10");
36 shouldBe("imageBorderWidth('10q ')", "10");
37 shouldBe("imageBorderWidth(' 10q ')", "10");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698