Index: third_party/WebKit/LayoutTests/svg/as-image/data-font-in-css-crash.html |
diff --git a/third_party/WebKit/LayoutTests/svg/as-image/data-font-in-css-crash.html b/third_party/WebKit/LayoutTests/svg/as-image/data-font-in-css-crash.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d099ea21d9849237df8465b798b2f553a4a203aa |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/svg/as-image/data-font-in-css-crash.html |
@@ -0,0 +1,26 @@ |
+<!DOCTYPE html> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<script> |
+var t1 = async_test("Loading of SVG with a valid font completes " + |
+ "before <img> load event and drawImage() doesn't crash."); |
+ |
+var imgOnLoadCalled = false; |
+ |
+var imgOnLoad = t1.step_func(function() { |
+ imgOnLoadCalled = true; |
+ |
+ var svg = document.getElementById('img'); |
+ var canvas = document.createElement("canvas"); |
+ var ctx = canvas.getContext("2d"); |
+ ctx.drawImage(svg, 0, 0); |
+}); |
+ |
+var bodyOnLoad = t1.step_func_done(function() { |
+ assert_true(imgOnLoadCalled, |
+ "<img> load event must be fired before <body> load event"); |
+}); |
+</script> |
+<body onload="bodyOnLoad()"> |
+<img src="resources/data-font-in-css.svg" id="img" onload="imgOnLoad()"> |
+</body> |