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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/images/border.html

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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/images/border-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 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html> 2 <title>This tests the HTMLImageElement border property.</title>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body> 3 <body>
7 <script src="script-tests/border.js"></script> 4 <script src="../../resources/testharness.js"></script>
8 </body> 5 <script src="../../resources/testharnessreport.js"></script>
9 </html> 6 <script type="text/javascript">
7 function imageBorderWidth(borderValue, style) {
8 var image = document.createElement("img");
9 if (borderValue !== undefined)
10 image.setAttribute("border", borderValue);
11 image.setAttribute("style", style);
12 image.setAttribute("width", "0");
13 document.body.appendChild(image);
14 var borderBoxWidth = image.offsetWidth;
15 document.body.removeChild(image);
16 return borderBoxWidth / 2;
17 }
18
19 test(function() {
20 assert_equals(imageBorderWidth(), 0);
21 assert_equals(imageBorderWidth(null), 0);
22 assert_equals(imageBorderWidth(''), 0);
23 assert_equals(imageBorderWidth(0), 0);
24 assert_equals(imageBorderWidth('x'), 0);
25 assert_equals(imageBorderWidth(undefined, 'border-width: 20px'), 0);
26
27 assert_equals(imageBorderWidth(null, 'border-width: 20px'), 20);
28 assert_equals(imageBorderWidth('', 'border-width: 20px'), 20);
29 assert_equals(imageBorderWidth('x', 'border-width: 20px'), 20);
30 assert_equals(imageBorderWidth(0, 'border-width: 20px'), 20);
31
32 assert_equals(imageBorderWidth(10), 10);
33 assert_equals(imageBorderWidth(' 10'), 10);
34 assert_equals(imageBorderWidth('10 '), 10);
35 assert_equals(imageBorderWidth(' 10 '), 10);
36 assert_equals(imageBorderWidth('10q'), 10);
37 assert_equals(imageBorderWidth(' 10q'), 10);
38 assert_equals(imageBorderWidth('10q '), 10);
39 assert_equals(imageBorderWidth(' 10q '), 10);
40 });
41 </script>
42
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/images/border-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698