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

Unified Diff: third_party/WebKit/LayoutTests/editing/execCommand/delete-non-editable-range-crash.html

Issue 2824633002: Reform editing/execCommand/delete-non-editable-range-crash.html (Closed)
Patch Set: Created 3 years, 8 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
Index: third_party/WebKit/LayoutTests/editing/execCommand/delete-non-editable-range-crash.html
diff --git a/third_party/WebKit/LayoutTests/editing/execCommand/delete-non-editable-range-crash.html b/third_party/WebKit/LayoutTests/editing/execCommand/delete-non-editable-range-crash.html
index 127b1e0dd15657ecfc6b04c54e5200b4c71e2c39..bd8cfefbddae8c9e49a9a0f1ba67e7f313b9f008 100644
--- a/third_party/WebKit/LayoutTests/editing/execCommand/delete-non-editable-range-crash.html
+++ b/third_party/WebKit/LayoutTests/editing/execCommand/delete-non-editable-range-crash.html
@@ -1,21 +1,39 @@
<!DOCTYPE html>
-<body contenteditable="true"><div contenteditable="true"><span contenteditable="true"><span contenteditable="true"><span contenteditable="true"><span contenteditable="true"><span contenteditable="false"><span contenteditable="true"><span contenteditable="true"><span contenteditable="true"><span contenteditable="true"><span contenteditable="true"><span contenteditable="true"><span contenteditable="true"><span contenteditable="true"><span>foo</span><ol>bar</ol></span><ol>bar</ol></span><ol>bar</ol></span><ol>bar</ol></span><ol>bar</ol></span><ol>bar</ol></span><ol>bar</ol></span><ol>bar</ol><head>
-<style>
-</style>
-
-</head></span><ol>bar</ol></span><ol>bar</ol></span><ol>bar</ol></span><ol>bar</ol></span><ol>bar</ol></span><ol>bar</ol></div><div></div>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../assert_selection.js"></script>
<script>
-if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.waitUntilDone();
-}
-
-document.execCommand("SelectAll");
-document.execCommand("Indent");
-
-window.setTimeout(function() {
- document.write("PASS");
- if (window.testRunner)
- testRunner.notifyDone();
-}, 0);
-</script>
+test(() => assert_selection(
+ [
+ '<div contenteditable="true">',
+ '<span contenteditable="false">',
+ '<span contenteditable="true">',
+ '<span>foo</span>',
+ '<ol>bar</ol>',
+ '</span>',
+ '<ol>bar</ol>',
+ '</span>',
+ '<ol>bar</ol>',
+ '</div>',
+ ].join(''),
+ selection => {
+ selection.document.designMode = 'on';
+ selection.document.execCommand('selectAll');
+ selection.document.execCommand('indent');
+ },
+ // Note: This is a crash test. The output HTML only reflects the current
+ // behavior, which may be incorrect due to the unusual input HTML.
+ [
+ '<div contenteditable="true">',
+ '<blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;">',
+ '<span>^foo<br></span>',
+ 'barbarbar',
+ '</blockquote>',
+ '<span contenteditable="false">',
+ '<span contenteditable="true">|</span>',
+ '<ol>bar</ol>',
+ '</span>',
+ '</div>'
+ ].join('')),
+ 'The test passes if it does not crash.');
+</script>

Powered by Google App Engine
This is Rietveld 408576698