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

Unified Diff: third_party/WebKit/LayoutTests/editing/spelling/spelling-attribute-change.html

Issue 2453313005: Convert editing/spelling/spelling-attribute-change.html with spellcheck_test (Closed)
Patch Set: Make everything verbose Created 4 years, 2 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/spelling/spelling-attribute-change.html
diff --git a/third_party/WebKit/LayoutTests/editing/spelling/spelling-attribute-change.html b/third_party/WebKit/LayoutTests/editing/spelling/spelling-attribute-change.html
index 68dcb8e37e28886b66dc62677f65c48a4774a9e2..1f14e69f374354343c27e8a6033d86b33f1ce966 100644
--- a/third_party/WebKit/LayoutTests/editing/spelling/spelling-attribute-change.html
+++ b/third_party/WebKit/LayoutTests/editing/spelling/spelling-attribute-change.html
@@ -1,11 +1,223 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src="../../resources/js-test.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-<script src="script-tests/spelling-attribute-change.js"></script>
-</body>
-</html>
+<!doctype html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../assert_selection.js"></script>
+<script src="spellcheck_test.js"></script>
+
+<script>
+spellcheck_test(
+ '<span contenteditable id="target"></span>',
+ document => {
+ const target = document.getElementById('target');
+ target.spellcheck = true;
+ target.focus();
+ document.execCommand('insertText', false, 'Hello,');
+ document.execCommand('insertText', false, 'zz.');
+ },
+ '<span contenteditable id="target" spellcheck="true">Hello,#zz#.</span>',
+ 'Change "spellcheck" of <span> from undefined to true');
+
+spellcheck_test(
+ '<span contenteditable id="target"></span>',
+ document => {
+ const target = document.getElementById('target');
+ target.spellcheck = false;
+ target.focus();
+ document.execCommand('insertText', false, 'Hello,');
+ document.execCommand('insertText', false, 'zz.');
+ },
+ '<span contenteditable id="target" spellcheck="false">Hello,zz.</span>',
+ 'Change "spellcheck" of <span> from undefined to false');
+
+spellcheck_test(
+ '<span contenteditable id="target" spellcheck="true"></span>',
+ document => {
+ const target = document.getElementById('target');
+ target.spellcheck = true;
+ target.focus();
+ document.execCommand('insertText', false, 'Hello,');
+ document.execCommand('insertText', false, 'zz.');
+ },
+ '<span contenteditable id="target" spellcheck="true">Hello,#zz#.</span>',
+ 'Change "spellcheck" of <span> from true to true');
+
+spellcheck_test(
+ '<span contenteditable id="target" spellcheck="true"></span>',
+ document => {
+ const target = document.getElementById('target');
+ target.spellcheck = false;
+ target.focus();
+ document.execCommand('insertText', false, 'Hello,');
+ document.execCommand('insertText', false, 'zz.');
+ },
+ '<span contenteditable id="target" spellcheck="false">Hello,zz.</span>',
+ 'Change "spellcheck" of <span> from true to false');
+
+spellcheck_test(
+ '<span contenteditable id="target" spellcheck="false"></span>',
+ document => {
+ const target = document.getElementById('target');
+ target.spellcheck = true;
+ target.focus();
+ document.execCommand('insertText', false, 'Hello,');
+ document.execCommand('insertText', false, 'zz.');
+ },
+ '<span contenteditable id="target" spellcheck="true">Hello,#zz#.</span>',
+ 'Change "spellcheck" of <span> from false to true');
+
+spellcheck_test(
+ '<span contenteditable id="target" spellcheck="false"></span>',
+ document => {
+ const target = document.getElementById('target');
+ target.spellcheck = false;
+ target.focus();
+ document.execCommand('insertText', false, 'Hello,');
+ document.execCommand('insertText', false, 'zz.');
+ },
+ '<span contenteditable id="target" spellcheck="false">Hello,zz.</span>',
+ 'Change "spellcheck" of <span> from false to false');
+
+spellcheck_test(
+ '<input id="target">',
+ document => {
+ const target = document.getElementById('target');
+ target.spellcheck = true;
+ target.focus();
+ document.execCommand('insertText', false, 'Hello,');
+ document.execCommand('insertText', false, 'zz.');
+ },
+ '<input id="target" spellcheck="true" value="Hello,#zz#.">',
+ 'Change "spellcheck" of <input> from undefined to true');
+
+spellcheck_test(
+ '<input id="target">',
+ document => {
+ const target = document.getElementById('target');
+ target.spellcheck = false;
+ target.focus();
+ document.execCommand('insertText', false, 'Hello,');
+ document.execCommand('insertText', false, 'zz.');
+ },
+ '<input id="target" spellcheck="false" value="Hello,zz.">',
+ 'Change "spellcheck" of <input> from undefined to false');
+
+spellcheck_test(
+ '<input id="target" spellcheck="true">',
+ document => {
+ const target = document.getElementById('target');
+ target.spellcheck = true;
+ target.focus();
+ document.execCommand('insertText', false, 'Hello,');
+ document.execCommand('insertText', false, 'zz.');
+ },
+ '<input id="target" spellcheck="true" value="Hello,#zz#.">',
+ 'Change "spellcheck" of <input> from true to true');
+
+spellcheck_test(
+ '<input id="target" spellcheck="true">',
+ document => {
+ const target = document.getElementById('target');
+ target.spellcheck = false;
+ target.focus();
+ document.execCommand('insertText', false, 'Hello,');
+ document.execCommand('insertText', false, 'zz.');
+ },
+ '<input id="target" spellcheck="false" value="Hello,zz.">',
+ 'Change "spellcheck" of <input> from true to false');
+
+spellcheck_test(
+ '<input id="target" spellcheck="false">',
+ document => {
+ const target = document.getElementById('target');
+ target.spellcheck = true;
+ target.focus();
+ document.execCommand('insertText', false, 'Hello,');
+ document.execCommand('insertText', false, 'zz.');
+ },
+ '<input id="target" spellcheck="true" value="Hello,#zz#.">',
+ 'Change "spellcheck" of <input> from false to true');
+
+spellcheck_test(
+ '<input id="target" spellcheck="false">',
+ document => {
+ const target = document.getElementById('target');
+ target.spellcheck = false;
+ target.focus();
+ document.execCommand('insertText', false, 'Hello,');
+ document.execCommand('insertText', false, 'zz.');
+ },
+ '<input id="target" spellcheck="false" value="Hello,zz.">',
+ 'Change "spellcheck" of <input> from false to false');
+
+spellcheck_test(
+ '<textarea id="target"></textarea>',
+ document => {
+ const target = document.getElementById('target');
+ target.spellcheck = true;
+ target.focus();
+ document.execCommand('insertText', false, 'Hello,');
+ document.execCommand('insertText', false, 'zz.');
+ },
+ '<textarea id="target" spellcheck="true">Hello,#zz#.</textarea>',
+ 'Change "spellcheck" of <textarea> from undefined to true');
+
+spellcheck_test(
+ '<textarea id="target"></textarea>',
+ document => {
+ const target = document.getElementById('target');
+ target.spellcheck = false;
+ target.focus();
+ document.execCommand('insertText', false, 'Hello,');
+ document.execCommand('insertText', false, 'zz.');
+ },
+ '<textarea id="target" spellcheck="false">Hello,zz.</textarea>',
+ 'Change "spellcheck" of <textarea> from undefined to false');
+
+spellcheck_test(
+ '<textarea id="target" spellcheck="true"></textarea>',
+ document => {
+ const target = document.getElementById('target');
+ target.spellcheck = true;
+ target.focus();
+ document.execCommand('insertText', false, 'Hello,');
+ document.execCommand('insertText', false, 'zz.');
+ },
+ '<textarea id="target" spellcheck="true">Hello,#zz#.</textarea>',
+ 'Change "spellcheck" of <textarea> from true to true');
+
+spellcheck_test(
+ '<textarea id="target" spellcheck="true"></textarea>',
+ document => {
+ const target = document.getElementById('target');
+ target.spellcheck = false;
+ target.focus();
+ document.execCommand('insertText', false, 'Hello,');
+ document.execCommand('insertText', false, 'zz.');
+ },
+ '<textarea id="target" spellcheck="false">Hello,zz.</textarea>',
+ 'Change "spellcheck" of <textarea> from true to false');
+
+spellcheck_test(
+ '<textarea id="target" spellcheck="false"></textarea>',
+ document => {
+ const target = document.getElementById('target');
+ target.spellcheck = true;
+ target.focus();
+ document.execCommand('insertText', false, 'Hello,');
+ document.execCommand('insertText', false, 'zz.');
+ },
+ '<textarea id="target" spellcheck="true">Hello,#zz#.</textarea>',
+ 'Change "spellcheck" of <textarea> from false to true');
+
+spellcheck_test(
+ '<textarea id="target" spellcheck="false"></textarea>',
+ document => {
+ const target = document.getElementById('target');
+ target.spellcheck = false;
+ target.focus();
+ document.execCommand('insertText', false, 'Hello,');
+ document.execCommand('insertText', false, 'zz.');
+ },
+ '<textarea id="target" spellcheck="false">Hello,zz.</textarea>',
+ 'Change "spellcheck" of <textarea> from false to false');
+</script>

Powered by Google App Engine
This is Rietveld 408576698