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

Unified Diff: third_party/WebKit/LayoutTests/editing/execCommand/5080333-1.html

Issue 1459783003: Make layout tests in editing/deleting and editing/execCommand to use w3c test harness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/5080333-1.html
diff --git a/third_party/WebKit/LayoutTests/editing/execCommand/5080333-1.html b/third_party/WebKit/LayoutTests/editing/execCommand/5080333-1.html
index eac346a0ee2290633cad6d3adef842ff708ba664..4423d95cb2e8e6449a8bcb70ffea703310fe6313 100644
--- a/third_party/WebKit/LayoutTests/editing/execCommand/5080333-1.html
+++ b/third_party/WebKit/LayoutTests/editing/execCommand/5080333-1.html
@@ -1,13 +1,23 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
<p>This tests for a bug where changing the alignment of an image would result in a selection that wasn't the one that was present before the alignment change. The image should be centered and the caret should be the same before and after the operation.</p>
<div id="div" contenteditable="true">foo<br><img src="../resources/abe.png"><br>baz</div>
-
+<div id="log"></div>
<script>
-var div = document.getElementById("div");
-var sel = window.getSelection();
+test(function() {
+ var div = document.getElementById('div');
+ var selection = window.getSelection();
+
+ selection.collapse(div, 0);
+ selection.modify('move', 'forward', 'paragraphBoundary');
+ selection.modify('move', 'forward', 'character');
-sel.collapse(div, 0);
-sel.modify("move", "forward", "paragraphBoundary");
-sel.modify("move", "forward", "character");
+ document.execCommand('JustifyCenter');
-document.execCommand("JustifyCenter");
+ assert_equals(div.innerHTML, 'foo<br><div style="text-align: center;"><img src="../resources/abe.png"></div>baz');
+ assert_true(selection.isCollapsed);
+ assert_equals(selection.anchorNode, div.childNodes[2]);
+ assert_equals(selection.anchorOffset, 0);
+});
</script>

Powered by Google App Engine
This is Rietveld 408576698