Title: [281195] trunk/LayoutTests
Revision
281195
Author
wenson_hs...@apple.com
Date
2021-08-18 09:58:52 -0700 (Wed, 18 Aug 2021)

Log Message

Add a layout test for webkit.org/b/229200
https://bugs.webkit.org/show_bug.cgi?id=229222
rdar://81636256

Reviewed by Simon Fraser.

Add a layout test to exercise the hang fixed in bug #229200. This test can be manually run by opening it in
browser and verifying that the page does not hang (and outputs the expected PASS messages).

* fast/canvas/draw-text-repeatedly-into-disconnected-canvas-expected.txt: Added.
* fast/canvas/draw-text-repeatedly-into-disconnected-canvas.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (281194 => 281195)


--- trunk/LayoutTests/ChangeLog	2021-08-18 16:58:30 UTC (rev 281194)
+++ trunk/LayoutTests/ChangeLog	2021-08-18 16:58:52 UTC (rev 281195)
@@ -1,3 +1,17 @@
+2021-08-18  Wenson Hsieh  <wenson_hs...@apple.com>
+
+        Add a layout test for webkit.org/b/229200
+        https://bugs.webkit.org/show_bug.cgi?id=229222
+        rdar://81636256
+
+        Reviewed by Simon Fraser.
+
+        Add a layout test to exercise the hang fixed in bug #229200. This test can be manually run by opening it in
+        browser and verifying that the page does not hang (and outputs the expected PASS messages).
+
+        * fast/canvas/draw-text-repeatedly-into-disconnected-canvas-expected.txt: Added.
+        * fast/canvas/draw-text-repeatedly-into-disconnected-canvas.html: Added.
+
 2021-08-18  Eric Hutchison  <ehutchi...@apple.com>
 
         [Mac wk1] css/css-position/position-relative-table* tests fail.

Added: trunk/LayoutTests/fast/canvas/draw-text-repeatedly-into-disconnected-canvas-expected.txt (0 => 281195)


--- trunk/LayoutTests/fast/canvas/draw-text-repeatedly-into-disconnected-canvas-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/canvas/draw-text-repeatedly-into-disconnected-canvas-expected.txt	2021-08-18 16:58:52 UTC (rev 281195)
@@ -0,0 +1,5 @@
+PASS Done painting
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/canvas/draw-text-repeatedly-into-disconnected-canvas.html (0 => 281195)


--- trunk/LayoutTests/fast/canvas/draw-text-repeatedly-into-disconnected-canvas.html	                        (rev 0)
+++ trunk/LayoutTests/fast/canvas/draw-text-repeatedly-into-disconnected-canvas.html	2021-08-18 16:58:52 UTC (rev 281195)
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<script src=""
+<script>
+jsTestIsAsync = true;
+addEventListener("load", async () => {
+    await document.fonts.load("16px Ahem");
+
+    for (let i = 0; i < 3; ++i)
+        await paintIntoCanvas();
+
+    await paintIntoCanvas(document.getElementById("final-target"));
+
+    testPassed("Done painting");
+    finishJSTest();
+});
+
+async function paintIntoCanvas(target) {
+    let canvas = target || document.createElement("canvas");
+    let context = canvas.getContext("2d");
+
+    context.font = "16px Ahem";
+    context.strokeText("Hello world", 10, 10);
+    context.strokeText("Hello world", 20, 20);
+
+    for (let i = 0; i < 5; ++i)
+        await UIHelper.renderingUpdate();
+
+    delete context;
+    delete canvas;
+    gc();
+}
+
+function gc() {
+    if (window.GCController)
+        return GCController.collect();
+
+    let strings = [];
+    for (let i = 0; i < 1000000; ++i)
+        strings.push(new String(i));
+}
+</script>
+<style>
+@font-face {
+    font-family: Ahem;
+    src: url("../../resources/Ahem.ttf");
+}
+
+canvas {
+    width: 400px;
+    height: 400px;
+    margin-top: 0;
+}
+</style>
+</head>
+<body>
+    <canvas width="400" height="400" id="final-target"></canvas>
+</body>
+</html>
\ No newline at end of file
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to