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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-text-space-characters.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 <canvas></canvas
5 <script src="../../resources/js-test.js"></script>
6 </head>
7 <body> 5 <body>
8 <canvas></canvas> 6 <script>
9 <script> 7 test(function(t) {
10
11 if (window.testRunner)
12 testRunner.dumpAsTextWithPixelResults();
13
14 var canvas = document.querySelector("canvas"); 8 var canvas = document.querySelector("canvas");
15 var context = canvas.getContext("2d"); 9 var context = canvas.getContext("2d");
16 10
17 var testStr1 = 'a' + '\u0009' + 'b' + '\u000A' + 'c' + '\u000C' + 'd' + '\u0 00D' + 'e'; 11 var testStr1 = 'a' + '\u0009' + 'b' + '\u000A' + 'c' + '\u000C' + 'd' + '\u0 00D' + 'e';
18 var testStr2 = 'a' + '\u0020' + 'b' + '\u0020' + 'c' + '\u0020' + 'd' + '\u0 020' + 'e'; 12 var testStr2 = 'a' + '\u0020' + 'b' + '\u0020' + 'c' + '\u0020' + 'd' + '\u0 020' + 'e';
19 13
20 context.font = "12px Arial"; 14 context.font = "12px Arial";
21 context.fillText(testStr1, 0, 10); 15 context.fillText(testStr1, 0, 10);
22 context.fillText(testStr2, 0, 30); 16 context.fillText(testStr2, 0, 30);
23 17
24 testStr1Width = context.measureText(testStr1).width; 18 testStr1Width = context.measureText(testStr1).width;
25 testStr2Width = context.measureText(testStr2).width; 19 testStr2Width = context.measureText(testStr2).width;
26 20
27 shouldBeTrue("testStr1Width == testStr2Width"); 21 assert_true(testStr1Width == testStr2Width);
28 22 }, 'Test canvas text characters space.');
29 </script> 23 </script>
30 </body> 24 </body>
31 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698