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

Unified Diff: third_party/WebKit/LayoutTests/editing/selection/node-removal-2.html

Issue 2972603002: Convert editing/selection/node-removal-2.html using assert_selection(). (Closed)
Patch Set: Created 3 years, 5 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 | third_party/WebKit/LayoutTests/platform/linux/editing/selection/node-removal-2-expected.png » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/editing/selection/node-removal-2.html
diff --git a/third_party/WebKit/LayoutTests/editing/selection/node-removal-2.html b/third_party/WebKit/LayoutTests/editing/selection/node-removal-2.html
index d32ba44b0d22f173ba732f0011c3fc20ab711191..2fa76b0af9a33bc16c655600a72c9896a01b56d8 100644
--- a/third_party/WebKit/LayoutTests/editing/selection/node-removal-2.html
+++ b/third_party/WebKit/LayoutTests/editing/selection/node-removal-2.html
@@ -1,38 +1,16 @@
-<html>
-<head>
+<!doctype html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../assert_selection.js"></script>
<script>
-if (window.testRunner)
- testRunner.dumpEditingCallbacks();
+test(() => {
+ assert_selection(
+ '^foo<span>b|ar</span>baz',
+ selection => {
+ const span = selection.document.querySelector('span');
+ span.parentNode.removeChild(span);
+ selection.document.execCommand('selectAll');
+ },
+ '^foobaz|');
+}, 'selectAll after node remove');
</script>
-
-
-<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
-
-<script>
-
-function runTest() {
- var selection = window.getSelection();
- var e = document.getElementById("test");
- var r = document.getElementById("removeme");
-
- selection.setBaseAndExtent(e, 0, r.childNodes[0], 2);
-
- r.parentNode.removeChild(r);
- selectAllCommand();
-}
-
-</script>
-
-<title>Removing the endpoints of a selection</title>
-</head>
-<body>
-<p>This tests behavior when a node that serves as the start or end of a selection is removed from the document. Ideally, we would just adjust the selection when an endpoint is removed, for now, we just blow away the selection.</p>
-<p>This test creates a selection that ends inside of a node that will be removed. Then the node is removed. Then a Select All is executed. The entire document should be selected.</p>
-<div id="test">
-hello <span style="color:red;" id="removeme">removeme</span> world!
-</div>
-
-<script>runTest()</script>
-
-</body>
-</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/platform/linux/editing/selection/node-removal-2-expected.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698