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

Unified Diff: third_party/WebKit/LayoutTests/svg/as-image/data-font-in-css-invalid-data-url-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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/svg/as-image/data-font-in-css-invalid-data-url-crash.html
diff --git a/third_party/WebKit/LayoutTests/svg/as-image/data-font-in-css-invalid-data-url-crash.html b/third_party/WebKit/LayoutTests/svg/as-image/data-font-in-css-invalid-data-url-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..601a4609eb208b083041507ba70edf2c4c1d5c27
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/svg/as-image/data-font-in-css-invalid-data-url-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 font with a invalid URL 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-invalid-data-url.svg" id="img" onload="imgOnLoad()">
+</body>

Powered by Google App Engine
This is Rietveld 408576698