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

Unified Diff: LayoutTests/editing/execCommand/replaceSelectorCommand-crash.html

Issue 149213006: Replace ASSERT by null-check in InsertedNodes::lastLeafInserted() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add layout test Created 6 years, 11 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
« no previous file with comments | « no previous file | LayoutTests/editing/execCommand/replaceSelectorCommand-crash-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/editing/execCommand/replaceSelectorCommand-crash.html
diff --git a/LayoutTests/editing/execCommand/replaceSelectorCommand-crash.html b/LayoutTests/editing/execCommand/replaceSelectorCommand-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..566b01f94397f337d12ec9adbc4f39556c608304
--- /dev/null
+++ b/LayoutTests/editing/execCommand/replaceSelectorCommand-crash.html
@@ -0,0 +1,80 @@
+<!DOCTYPE html>
+<script>
+ if (window.testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+ }
+
+ var af = [], i = 0;
+ var setIntervalId;
+ var done = false;
+
+ function main() {
+ if (done)
+ return;
+
+ if (i == 20 * af.length) {
+ done = true;
+ document.body.innerHTML += "<p>Test for crbug.com/338982. Passes if it does not crash</p>";
+ document.body.innerHTML += "<p>PASS</p>";
+ clearInterval(setIntervalId);
+ if (window.testRunner)
+ testRunner.notifyDone();
+ return;
+ }
+
+ af[i++ % af.length]();
+ }
+
+ af.push(function() {
+ document.designMode="on";
+ document.execCommand("SelectAll");
+ try {
+ window._Document_0 = document;
+ } catch(e) {
+ console.log(e)
+ };
+ });
+
+ af.push(function() {
+ document.execCommand("Underline", false);
+ });
+
+ af.push(function() {
+ try {
+ window._Selection_0 = window._Document_0.getSelection();
+ } catch(e) {
+ console.log(e)
+ };
+ });
+
+ af.push(function() {
+ document.execCommand("InsertParagraph");
+ });
+
+ af.push(function() {
+ try {
+ window._Selection_0.modify("move", "forward", "line");
+ } catch(e) {
+ console.log(e)
+ }
+ document.execCommand("Delete", false);
+ });
+
+ af.push(function() {
+ document.execCommand("Indent");
+ });
+
+ af.push(function() {
+ document.execCommand("InsertOrderedList");
+ document.execCommand("InsertImage", false);
+ });
+
+ af.push(function() {});
+ af.push(function() {});
+ af.push(function() {});
+
+ document.addEventListener("DOMNodeInserted", main, false);
+ setIntervalId = setInterval(main, 10);
+</script>
+<input>
« no previous file with comments | « no previous file | LayoutTests/editing/execCommand/replaceSelectorCommand-crash-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698