Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <script src="../../resources/testharness.js"></script> |
| 2 <html> | 2 <script src="../../resources/testharnessreport.js"></script> |
| 3 <head> | |
| 4 <script src="../../resources/js-test.js"></script> | |
| 5 </head> | |
| 6 <body> | 3 <body> |
| 7 <script src="script-tests/canvas-font-ex-units-crash.js"></script> | 4 <script> |
| 5 test(function(t) { | |
| 6 | |
| 7 ctx = document.createElement('canvas').getContext('2d'); | |
|
Justin Novosad
2017/02/03 18:39:32
indent
zakerinasab
2017/02/09 18:11:03
Done.
| |
| 8 | |
| 9 ctx.font = "5ex sans-serif"; | |
| 10 | |
| 11 size = parseInt(ctx.font.substr(0, 2)); | |
| 12 family = ctx.font.substr(5); | |
| 13 | |
| 14 assert_approx_equals(size, 25, 10); | |
| 15 assert_equals(family, 'sans-serif'); | |
| 16 | |
| 17 }, "Test that setting a font with size in 'ex' units doesn't crash."); | |
| 18 </script> | |
| 8 </body> | 19 </body> |
| 9 </html> | |
| OLD | NEW |