Add a Layout test for r188991
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Aug 2015 14:26:20 +0000 (14:26 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Aug 2015 14:26:20 +0000 (14:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=148507

Reviewed by Tim Horton.

Tests that stopping an animation early and closing the window does
not crash the process. This is a retrospective test added for
https://bugs.webkit.org/show_bug.cgi?id=148442, "Fix crash due to
animationDidEnd called on deallocated RemoteLayerTreeHost."

* animations/crash-on-removing-animation.html: Added.
* animations/crash-on-removing-animation-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189022 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/animations/crash-on-removing-animation-expected.txt [new file with mode: 0644]
LayoutTests/animations/crash-on-removing-animation.html [new file with mode: 0644]

index df7b2464569d59ce41d8e6fa64128d07f4f53b40..3fe07311486f6528266931d4ac559220e3301c08 100644 (file)
@@ -1,3 +1,18 @@
+2015-08-26  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Add a Layout test for r188991
+        https://bugs.webkit.org/show_bug.cgi?id=148507
+
+        Reviewed by Tim Horton.
+
+        Tests that stopping an animation early and closing the window does
+        not crash the process. This is a retrospective test added for
+        https://bugs.webkit.org/show_bug.cgi?id=148442, "Fix crash due to
+        animationDidEnd called on deallocated RemoteLayerTreeHost."
+
+        * animations/crash-on-removing-animation.html: Added.
+        * animations/crash-on-removing-animation-expected.txt: Added.
+
 2015-08-27  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         [EFL] REGRESSION: userscripts tests crash
diff --git a/LayoutTests/animations/crash-on-removing-animation-expected.txt b/LayoutTests/animations/crash-on-removing-animation-expected.txt
new file mode 100644 (file)
index 0000000..4f28386
--- /dev/null
@@ -0,0 +1,4 @@
+PASS successfullyParsed is true
+
+TEST COMPLETE
+If you are reading this, we managed to avoid crashing!
diff --git a/LayoutTests/animations/crash-on-removing-animation.html b/LayoutTests/animations/crash-on-removing-animation.html
new file mode 100644 (file)
index 0000000..ab9e1e5
--- /dev/null
@@ -0,0 +1,55 @@
+<html>
+
+<head>
+    <script src="../resources/js-test-pre.js"></script>
+    <script>
+    var successfullyParsed = false;
+    window.jsTestIsAsync = true;
+
+    function tryToCrash() {
+        var div = document.getElementById("test");
+        div.style.webkitTransform = "translateY(1px)";
+        div.style.webkitTransition = "1s ease-in-out";
+        setTimeout(function() {
+            div.style.webkitTransform = "none";
+            div.style.webkitTransition = "none";
+            setTimeout(function() {
+                window.close();
+                window.opener.finishJSTest();
+            }, 0);
+        }, 0);
+    }
+
+    function setup() {
+        if (window.testRunner) {
+            if (location.href.indexOf("auxillary") != -1) {
+                setTimeout(tryToCrash, 0);
+            } else {
+                testRunner.setCanOpenWindows();
+                window.open("crash-on-removing-animation.html#auxillary");
+            }
+        } else {
+            document.write("This test must be run in DRT/WKTR.");
+        }
+    }
+    </script>
+
+    <style>
+    #test {
+        background-color: blue;
+        width: 10px;
+        height: 10px;
+    }
+    </style>
+<head>
+
+<body onload="setup()">
+    <div id="test"></div>
+    <script>
+        successfullyParsed = true;
+    </script>
+    <p>If you are reading this, we managed to avoid crashing!</p>
+    <script src="../resources/js-test-post.js"></script>
+</body>
+
+</html>