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

Unified Diff: third_party/WebKit/LayoutTests/editing/style/style_boundary.html

Issue 2255683002: Convert editing/style/style-boundary-00[1-4].html to use w3c test harness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-08-17T13:43:12 Created 4 years, 4 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/style/style_boundary.html
diff --git a/third_party/WebKit/LayoutTests/editing/style/style_boundary.html b/third_party/WebKit/LayoutTests/editing/style/style_boundary.html
new file mode 100644
index 0000000000000000000000000000000000000000..a110827dceed45e03b53b9812fa4326fa642fdd8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/style/style_boundary.html
@@ -0,0 +1,64 @@
+<!doctype html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../assert_selection.js"></script>
+<script>
+ test(() => assert_selection(
+ [
+ '<div contenteditable style="word-wrap: break-word;">',
+ '<div><b>a</b>^b|</div>',
+ '</div>'
+ ].join(''),
+ 'bold',
+ [
+ '<div contenteditable style="word-wrap: break-word;">',
+ '<div><b>a^b|</b></div>',
+ '</div>'
+ ].join('')),
+ 'Extend previous B');
+
+ test(() => assert_selection(
+ [
+ '<div contenteditable style="word-wrap: break-word;">',
+ '<div><b>a|</b>c</div>',
+ '</div>'
+ ].join(''),
+ 'insertText b',
+ [
+ '<div contenteditable style="word-wrap: break-word;">',
+ '<div><b>ab|</b>c</div>',
+ '</div>'
+ ].join('')),
+ 'Insert a character into existing B');
+
+ test(() => assert_selection(
+ [
+ '<div contenteditable style="word-wrap: break-word;">',
+ '<div><b>a|</b>c</div>',
+ '</div>'
+ ].join(''),
+ selection => {
+ selection.document.execCommand('bold'); // disable bold
+ selection.document.execCommand('insertText', false, 'b');
+ },
+ [
+ '<div contenteditable style="word-wrap: break-word;">',
+ '<div><b>a</b>b|c</div>',
+ '</div>'
+ ].join('')),
+ 'Simulate Ctrl+B then typing a character');
+
+ test(() => assert_selection(
+ [
+ '<div contenteditable style="word-wrap: break-word;">',
+ '<div><div><b>a</b></div><div>^b|</div></div>',
Xiaocheng 2016/08/17 05:56:48 The initial selection should be something like '<d
yosin_UTC9 2016/08/17 06:39:53 Yes, you're right. Selection anchor is after "a".
+ '</div>'
+ ].join(''),
+ 'bold',
+ [
+ '<div contenteditable style="word-wrap: break-word;">',
+ '<div><div><b>a</b></div><div><b>^b|</b></div></div>',
+ '</div>'
+ ].join('')),
+ 'B element should not spread beyond DIV');
+</script>

Powered by Google App Engine
This is Rietveld 408576698