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

Side by Side Diff: third_party/WebKit/LayoutTests/svg/as-image/adopt-while-async-svg-load-is-in-progress-crash.html

Issue 2905833003: Make Image::image_observer_ WeakPersistent (Closed)
Patch Set: Reflect comments Created 3 years, 6 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <script>
5 var t = async_test("Garbage collection of ImageResourceContent while " +
6 "asynchronous loading of SVG is in progress " +
7 "shouldn't crash. crbug.com/726220");
8 var img;
9
10 function step1() {
11 setTimeout(t.step_func(step2), 0);
12
13 // 1. Creating an <img> element with SVG of which loading is not completed
14 // synchronously.
15 img = document.createElement('img');
16 img.src='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"><foreignOb ject><body xmlns="http://www.w3.org/1999/xhtml"><marquee></marquee></body></fore ignObject></svg>';
17 document.body.appendChild(img);
18 assert_false(img.complete);
19 }
20
21 function step2() {
22 // 2. Adopt the <img> to a new document.
23 newdoc = document.implementation.createDocument("svg", null);
24 newdoc.adoptNode(img);
25
26 // 3. Do garbage collection. The oold ImageResourceContent is garbage
27 // collected while async SVG loading is still in progress.
28 gc();
29
30 setTimeout(t.step_func_done(), 100);
31 }
32
33 </script>
34 <body onload="setTimeout(t.step_func(step1), 0)"></body>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698