Add test to confirm we do not crash in media destruction
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Jul 2016 19:46:14 +0000 (19:46 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Jul 2016 19:46:14 +0000 (19:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=122816

Test based on a Blink change (patch by <igor.o@sisa.samsung.com>):
<https://chromium.googlesource.com/chromium/blink/+/7a2b2dcefbc013003487d5055eeda7a57daafa93%5E%21/#F0>

We do not seem to have the bug that prompted the Chromium source change. Adding
test case to ensure we do not introduce this problem in the future.

* editing/undo/audio-in-undo-stack-crash-expected.txt: Added.
* editing/undo/audio-in-undo-stack-crash.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/editing/undo/audio-in-undo-stack-crash-expected.txt [new file with mode: 0644]
LayoutTests/editing/undo/audio-in-undo-stack-crash.html [new file with mode: 0644]

index 7fc3211..a6a8b4a 100644 (file)
@@ -1,3 +1,17 @@
+2016-07-14  Brent Fulgham  <bfulgham@apple.com>
+
+        Add test to confirm we do not crash in media destruction
+        https://bugs.webkit.org/show_bug.cgi?id=122816
+
+        Test based on a Blink change (patch by <igor.o@sisa.samsung.com>):
+        <https://chromium.googlesource.com/chromium/blink/+/7a2b2dcefbc013003487d5055eeda7a57daafa93%5E%21/#F0>
+
+        We do not seem to have the bug that prompted the Chromium source change. Adding
+        test case to ensure we do not introduce this problem in the future.
+
+        * editing/undo/audio-in-undo-stack-crash-expected.txt: Added.
+        * editing/undo/audio-in-undo-stack-crash.html: Added.
+
 2016-07-14  Youenn Fablet  <youenn@apple.com>
 
         Remove support for value iterators from JSDOMIterator
diff --git a/LayoutTests/editing/undo/audio-in-undo-stack-crash-expected.txt b/LayoutTests/editing/undo/audio-in-undo-stack-crash-expected.txt
new file mode 100644 (file)
index 0000000..66146b5
--- /dev/null
@@ -0,0 +1 @@
+PASS; NOT CRASHED
diff --git a/LayoutTests/editing/undo/audio-in-undo-stack-crash.html b/LayoutTests/editing/undo/audio-in-undo-stack-crash.html
new file mode 100644 (file)
index 0000000..7cba96e
--- /dev/null
@@ -0,0 +1,32 @@
+<div id="container">
+<iframe></iframe>
+<div id="sample" contenteditable="true">
+Foo<audio id="audio" src="bottom"></audio>Bar
+</div>
+</div>
+<script>
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+}
+function clearUndoStack() {
+    document.querySelector('iframe').outerHTML = '';
+}
+function $(id) { return document.getElementById(id); }
+$('sample').focus();
+var range = document.createRange();
+range.selectNodeContents($('sample'));
+var selection = window.getSelection();
+selection.removeAllRanges();
+selection.addRange(range);
+setTimeout(function() {
+    clearUndoStack();
+}, 0);
+window.onload = function() {
+    $('container').outerHTML = 'PASS; NOT CRASHED';
+    if (window.testRunner)
+        testRunner.notifyDone();
+};
+document.execCommand('Delete', false);
+document.execCommand('InsertUnorderedList', false);
+</script>
\ No newline at end of file