Index: third_party/WebKit/LayoutTests/editing/undo/redo_rebalance_whitespace.html |
diff --git a/third_party/WebKit/LayoutTests/editing/undo/redo_rebalance_whitespace.html b/third_party/WebKit/LayoutTests/editing/undo/redo_rebalance_whitespace.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..61dfbad8f3d4408db2024895b9d60791dde73307 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/editing/undo/redo_rebalance_whitespace.html |
@@ -0,0 +1,29 @@ |
+ |
+<!doctype html> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<script src="../assert_selection.js"></script> |
+<script> |
+ // This tests RebalanceWhitespace's ability to Undo. |
+ test(() => assert_selection( |
+ [ |
+ '<div contenteditable style="word-wrap: break-word;">', |
+ '<div>( |)</div>', |
+ '</div>', |
+ ].join(''), |
+ selection => { |
+ Array.of('this is a test. ').forEach(character => { |
+ selection.document.execCommand('insertText', false, character); |
+ }); |
+ selection.document.execCommand('undo'); |
+ selection.document.execCommand('redo'); |
+ selection.document.execCommand('undo'); |
+ selection.document.execCommand('redo'); |
+ }, |
+ [ |
+ '<div contenteditable style="word-wrap: break-word;">', |
+ '<div>( this is a test. |)</div>', |
+ '</div>', |
+ ].join('')), |
+ 'Redo Typing can add extra space characters'); |
+</script> |