2010-11-04 MORITA Hajime <morrita@google.com>
authormorrita@google.com <morrita@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Nov 2010 04:58:51 +0000 (04:58 +0000)
committermorrita@google.com <morrita@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Nov 2010 04:58:51 +0000 (04:58 +0000)
        Reviewed by Kent Tamura.

        Expectation of /editing/spelling/spelling-textarea.html is confusing
        https://bugs.webkit.org/show_bug.cgi?id=48818

        - Turned spelling-contenteditable.html and spelling-textarea.html into
          single script-test named spelling-hasspellingmarker.html,
          which uses shouldBe() family for the assertion. The original tests
          misused testPassed() for printing.
        - Added a test for <input>, which possibly goes different path from
          editing <textarea> and @contentEditable.
        - Added a "false" case test to catch the error that results true for anything.

        * editing/spelling/script-tests/spelling-hasspellingmarker.js: Added.
        * editing/spelling/spelling-contenteditable-expected.txt: Removed.
        * editing/spelling/spelling-contenteditable.html: Removed.
        * editing/spelling/spelling-hasspellingmarker-expected.txt: Added.
        * editing/spelling/spelling-hasspellingmarker.html: Added.
        * editing/spelling/spelling-textarea-expected.txt: Removed.
        * editing/spelling/spelling-textarea.html: Removed.
        * platform/chromium/test_expectations.txt:
        * platform/gtk/Skipped:
        * platform/qt/Skipped:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@71392 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/editing/spelling/script-tests/spelling-hasspellingmarker.js [new file with mode: 0644]
LayoutTests/editing/spelling/spelling-contenteditable-expected.txt [deleted file]
LayoutTests/editing/spelling/spelling-contenteditable.html [deleted file]
LayoutTests/editing/spelling/spelling-hasspellingmarker-expected.txt [new file with mode: 0644]
LayoutTests/editing/spelling/spelling-hasspellingmarker.html [new file with mode: 0644]
LayoutTests/editing/spelling/spelling-textarea-expected.txt [deleted file]
LayoutTests/editing/spelling/spelling-textarea.html [deleted file]
LayoutTests/platform/chromium/test_expectations.txt
LayoutTests/platform/gtk/Skipped
LayoutTests/platform/qt/Skipped

index 6e8568a..ef33b8c 100644 (file)
@@ -1,3 +1,29 @@
+2010-11-04  MORITA Hajime  <morrita@google.com>
+
+        Reviewed by Kent Tamura.
+
+        Expectation of /editing/spelling/spelling-textarea.html is confusing
+        https://bugs.webkit.org/show_bug.cgi?id=48818
+        
+        - Turned spelling-contenteditable.html and spelling-textarea.html into
+          single script-test named spelling-hasspellingmarker.html,
+          which uses shouldBe() family for the assertion. The original tests
+          misused testPassed() for printing.
+        - Added a test for <input>, which possibly goes different path from
+          editing <textarea> and @contentEditable.
+        - Added a "false" case test to catch the error that results true for anything.
+
+        * editing/spelling/script-tests/spelling-hasspellingmarker.js: Added.
+        * editing/spelling/spelling-contenteditable-expected.txt: Removed.
+        * editing/spelling/spelling-contenteditable.html: Removed.
+        * editing/spelling/spelling-hasspellingmarker-expected.txt: Added.
+        * editing/spelling/spelling-hasspellingmarker.html: Added.
+        * editing/spelling/spelling-textarea-expected.txt: Removed.
+        * editing/spelling/spelling-textarea.html: Removed.
+        * platform/chromium/test_expectations.txt:
+        * platform/gtk/Skipped:
+        * platform/qt/Skipped:
+
 2010-11-04  Antonio Gomes  <agomes@rim.com>
 
         Rubber-stamped by Martin Robinson.
diff --git a/LayoutTests/editing/spelling/script-tests/spelling-hasspellingmarker.js b/LayoutTests/editing/spelling/script-tests/spelling-hasspellingmarker.js
new file mode 100644 (file)
index 0000000..d08ddd0
--- /dev/null
@@ -0,0 +1,23 @@
+description('This tests Layouttestcontroller.hasSpellingMarker works for differnt type of elements.');
+
+var parent = document.createElement("div");
+document.body.appendChild(parent);
+
+function hasMarked(markup)
+{
+    parent.innerHTML = markup;
+    document.getElementById('test').focus();
+    document.execCommand("InsertText", false, 'z');
+    document.execCommand("InsertText", false, 'z');
+    document.execCommand("InsertText", false, ' ');
+
+    return layoutTestController.hasSpellingMarker(0, 2);
+}
+
+shouldBeTrue("hasMarked(\"<textarea id='test' cols='80' rows='10'></textarea>\");");
+shouldBeTrue("hasMarked(\"<input id='test' type='text'>\");");
+shouldBeTrue("hasMarked(\"<div id='test' contenteditable='true'></div>\");");
+shouldBeFalse("hasMarked(\"<div id='test' contentEditable='true' spellcheck='false'></div>\");");
+parent.innerHTML = "";
+
+var successfullyParsed = true;
diff --git a/LayoutTests/editing/spelling/spelling-contenteditable-expected.txt b/LayoutTests/editing/spelling/spelling-contenteditable-expected.txt
deleted file mode 100644 (file)
index 37af821..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-This tests we can write text tests for spellcheckers. To test manually, type 'zz ' in the contenteditable <div> element and see they are marked as misspelled.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-zz 
-PASS 'zz' is marked as misspelled.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/editing/spelling/spelling-contenteditable.html b/LayoutTests/editing/spelling/spelling-contenteditable.html
deleted file mode 100644 (file)
index d2369c3..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<html>
-<head>
-<link rel="stylesheet" href="../js/resources/js-test-style.css">
-<script src="../../fast/js/resources/js-test-pre.js" language="javascript" type="text/javascript"></script>
-<script src="../editing.js" language="javascript" type="text/javascript"></script>
-<title>Editing Test</title> 
-</head> 
-<body>
-<p id="description"></p>
-<div id="test" contenteditable="true"></div>
-<div id="console"></div>
-<script language="javascript" type="text/javascript">
-description('This tests we can write text tests for spellcheckers. To test manually, type \'zz \' in the contenteditable &lt;div&gt; element and see they are marked as misspelled.');
-
-function logResult(result) {
-    if (result)
-        testPassed('\'zz\' is marked as misspelled.');
-    else
-        testPassed('\'zz\' is not marked as misspelled.');
-}
-
-if (window.layoutTestController) {
-    // Type the test text 'zz '.
-    document.getElementById('test').focus();
-    typeCharacterCommand('z');
-    typeCharacterCommand('z');
-    typeCharacterCommand(' ');
-
-    // Test the above 'zz' is marked as misspelled. We test it only on platforms that implement
-    // textInputController.hasSpellingMarker() to avoid exceptions.
-    logResult(layoutTestController.hasSpellingMarker(0, 2));
-}
-
-var successfullyParsed = true;
-</script>
-<script src="../../fast/js/resources/js-test-post.js"></script>
-</body>
-</html>
diff --git a/LayoutTests/editing/spelling/spelling-hasspellingmarker-expected.txt b/LayoutTests/editing/spelling/spelling-hasspellingmarker-expected.txt
new file mode 100644 (file)
index 0000000..2b8582a
--- /dev/null
@@ -0,0 +1,13 @@
+This tests Layouttestcontroller.hasSpellingMarker works for differnt type of elements.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS hasMarked("<textarea id='test' cols='80' rows='10'></textarea>"); is true
+PASS hasMarked("<input id='test' type='text'>"); is true
+PASS hasMarked("<div id='test' contenteditable='true'></div>"); is true
+PASS hasMarked("<div id='test' contentEditable='true' spellcheck='false'></div>"); is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/editing/spelling/spelling-hasspellingmarker.html b/LayoutTests/editing/spelling/spelling-hasspellingmarker.html
new file mode 100644 (file)
index 0000000..751f750
--- /dev/null
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<script src="resources/js-test-selection-shared.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/spelling-hasspellingmarker.js"></script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/editing/spelling/spelling-textarea-expected.txt b/LayoutTests/editing/spelling/spelling-textarea-expected.txt
deleted file mode 100644 (file)
index fac07ce..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-This tests we can write text tests for spellcheckers. To test manually, type 'zz ' in the <textarea> element and see they are marked as misspelled.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-
-PASS 'zz' is marked as misspelled.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/editing/spelling/spelling-textarea.html b/LayoutTests/editing/spelling/spelling-textarea.html
deleted file mode 100644 (file)
index be416b5..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<html>
-<head>
-<link rel="stylesheet" href="../js/resources/js-test-style.css">
-<script src="../../fast/js/resources/js-test-pre.js" language="javascript" type="text/javascript"></script>
-<script src=../editing.js language="javascript" type="text/javascript"></script>
-<title>Editing Test</title> 
-</head> 
-<body>
-<p id="description"></p>
-<textarea id="test" cols="80" rows="10"></textarea>
-<div id="console"></div>
-<script language="javascript" type="text/javascript">
-description('This tests we can write text tests for spellcheckers. To test manually, type \'zz \' in the &lt;textarea&gt; element and see they are marked as misspelled.');
-
-function logResult(result) {
-    if (result)
-        testPassed('\'zz\' is marked as misspelled.');
-    else
-        testPassed('\'zz\' is not marked as misspelled.');
-}
-
-if (window.layoutTestController) {
-    // Type the test text 'zz '.
-    document.getElementById('test').focus();
-    typeCharacterCommand('z');
-    typeCharacterCommand('z');
-    typeCharacterCommand(' ');
-
-    // Test the above 'zz' is marked as misspelled. We test it only on platforms that implement
-    // textInputController.hasSpellingMarker() to avoid exceptions.
-    logResult(layoutTestController.hasSpellingMarker(0, 2));
-}
-
-var successfullyParsed = true;
-</script>
-<script src="../../fast/js/resources/js-test-post.js"></script>
-</body>
-</html>
index fcfcd30..560cb9f 100644 (file)
@@ -734,8 +734,7 @@ BUG58254 MAC : platform/mac/editing/spelling/autocorrection-removing-underline-a
 BUG58254 MAC : platform/mac/editing/spelling/autocorrection-removing-underline.html = IMAGE+TEXT
 BUG58254 MAC : platform/mac/editing/spelling/autocorrection-simple.html = IMAGE+TEXT
 
-BUGJAMESR WIN LINUX : editing/spelling/spelling-contenteditable.html = TEXT
-BUGJAMESR WIN LINUX : editing/spelling/spelling-textarea.html = TEXT
+BUGJAMESR WIN LINUX : editing/spelling/spelling-hasspellingmarker.html = TEXT
 
 // Directionality of mixed-direction text in selected choice should
 // match that in the <select> option lists.
index 0beae32..68ccb76 100644 (file)
@@ -979,8 +979,7 @@ editing/selection/unrendered-space.html
 editing/selection/word-granularity.html
 editing/spelling/inline_spelling_markers.html
 editing/spelling/spellcheck-attribute.html
-editing/spelling/spelling-contenteditable.html
-editing/spelling/spelling-textarea.html
+editing/spelling/spelling-hasspellingmarker.html
 editing/spelling/spelling-backspace-between-lines.html
 editing/spelling/spelling-linebreak.html
 editing/spelling/spelling-attribute-change.html
index 53922dd..a15c405 100644 (file)
@@ -2243,8 +2243,7 @@ editing/spelling/spellcheck-attribute.html
 editing/spelling/spelling.html
 
 # textInputController.hasSpellingMarkers() is not implemented.
-editing/spelling/spelling-contenteditable.html
-editing/spelling/spelling-textarea.html
+editing/spelling/spelling-hasspellingmarker.html
 
 # https://bugs.webkit.org/show_bug.cgi?id=45435
 editing/spelling/spelling-backspace-between-lines.html