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

Side by Side Diff: third_party/WebKit/LayoutTests/svg/as-image/data-font-in-css-crash.html

Issue 2613853002: Phase III Step 2: Call imageNotifyFinished() and image load event after SVG loading completes (Closed)
Patch Set: Rebase Created 3 years, 7 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 <!DOCTYPE html>
2 <html>
3 <head>
fs 2017/05/05 10:52:42 uNit: <html> and <head> (and corresponding end tag
hiroshige 2017/05/08 17:22:06 Done.
4 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script>
6 <script>
7 var t1 = async_test("Loading of SVG with a valid font completes " +
fs 2017/05/05 10:52:42 Personally I think I would've written these tests
hiroshige 2017/05/08 17:22:06 Done.
8 "before <img> load event and drawImage() doesn't crash.");
9 var t2 = async_test("Loading of SVG with a valid font completes " +
10 "before <body> load event and drawImage() doesn't crash.");
11
12 var imgOnLoadCalled = false;
13
14 function doTest() {
15 var svg = document.getElementById('img');
16 var canvas = document.createElement("canvas");
17 var ctx = canvas.getContext("2d");
18 ctx.drawImage(svg, 0, 0);
19 }
20
21 var imgOnLoad = t1.step_func_done(function() {
22 imgOnLoadCalled = true;
23 doTest();
24 });
25
26 var bodyOnLoad = t2.step_func_done(function() {
27 assert_true(imgOnLoadCalled,
28 "<img> load event must be fired before <body> load event");
29 doTest();
30 });
31 </script>
32 </head>
33 <body onload="bodyOnLoad()">
34 <img src="resources/data-font-in-css.svg" id="img" onload="imgOnLoad()">
35 </body>
36 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698