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

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

Issue 2294193002: Convert editing/style/smoosh-styles-00[13].html to use w3c test harness (Closed)
Patch Set: 2016-08-31T18:55:30 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/smoosh_styles.html
diff --git a/third_party/WebKit/LayoutTests/editing/style/smoosh_styles.html b/third_party/WebKit/LayoutTests/editing/style/smoosh_styles.html
new file mode 100644
index 0000000000000000000000000000000000000000..d3d6d7b223534a499df0e05df2b913e945993df7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/style/smoosh_styles.html
@@ -0,0 +1,51 @@
+<!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>',
+ '<div><span id="sample" style="color: red;">abfg</span></div>',
+ '<div>^cde|</div>',
+ '</div>',
+ ].join(''),
+ selection => {
+ assert_not_equals(window.testRunner, undefined,
+ 'This test requires testRunner');
+ selection.document.execCommand('cut');
+ selection.document.execCommand('delete');
+ const sample = selection.document.getElementById('sample');
+ selection.collapse(sample.firstChild, 2);
+ selection.document.execCommand('paste');
yoichio 2016/09/01 07:56:46 Can we have clipboard function in assert_selection
+ },
+ [
+ '<div contenteditable>',
+ '<div>',
+ '<span id="sample" style="color: red;">ab</span>',
+ 'cde|',
+ '<span style="color: red;">fg</span>',
+ '</div>',
+ '</div>',
+ ].join('')),
+ 'Paste into middle of colored SPAN');
+
+ test(() => assert_selection(
+ [
+ '<div contenteditable>',
+ '<div style="margin-left: 40px; text-indent: -40px;">^foo|</div>',
+ '</div>',
+ ].join(''),
+ selection => {
+ assert_not_equals(window.testRunner, undefined,
+ 'This test requires testRunner');
+ selection.document.execCommand('cut');
+ selection.document.execCommand('paste');
+ },
+ [
+ '<div contenteditable>',
+ '<div style="margin-left: 40px; text-indent: -40px;">foo|</div>',
+ '</div>',
+ ].join('')),
+ 'Keep text-indent at pasting');
+</script>

Powered by Google App Engine
This is Rietveld 408576698