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