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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-text-ideographic-space.html

Issue 2695963004: Use testharness.js instead of js-test.js in LayoutTests/fast/canvas tests. (Closed)
Patch Set: Created 3 years, 10 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
1 <!DOCTYPE html> 1 <meta charcode="utf-16">
2 <html> 2 <script src="../../resources/testharness.js"></script>
3 <head> 3 <script src="../../resources/testharnessreport.js"></script>
4 <meta charcode="utf-16"> 4 <style>
5 <script src="../../resources/js-test.js"></script>
6 <style>
7
8 span { 5 span {
9 padding : 0px; 6 padding : 0px;
10 font-size : 12px; 7 font-size : 12px;
11 font-family : Arial; 8 font-family : Arial;
12 display : inline; 9 display : inline;
13 } 10 }
11 </style>
12 <body>
13 <div><span>a&#x3000;b&#x3000;c</span></div>
14 <div><canvas></canvas></div>
14 15
15 </style> 16 <script>
16 </head> 17 test(function(t) {
17 <body>
18 <div><span>a&#x3000;b&#x3000;c</span></div>
19 <div><canvas></canvas></div>
20 <script>
21
22 var canvas = document.querySelector("canvas"); 18 var canvas = document.querySelector("canvas");
23 var context = canvas.getContext("2d"); 19 var context = canvas.getContext("2d");
24 var span = document.querySelector("span"); 20 var span = document.querySelector("span");
25 21
26 var abc = 'a' + '\u3000' + 'b' + '\u3000' + 'c'; 22 var abc = 'a' + '\u3000' + 'b' + '\u3000' + 'c';
27 context.font = "12px Arial"; 23 context.font = "12px Arial";
28 context.fillText(abc, 0, 20); 24 context.fillText(abc, 0, 20);
29 25
30 spanWidth = span.offsetWidth; 26 spanWidth = span.offsetWidth;
31 canvasWidth = context.measureText(abc).width; 27 canvasWidth = context.measureText(abc).width;
32 shouldBeTrue("spanWidth == canvasWidth"); 28 assert_true(spanWidth == canvasWidth);
33 29 }, 'Test canvas text ideographic space.');
34 </script> 30 </script>
35 </body> 31 </body>
36 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698