Bug 48818 - Expectation of /editing/spelling/spelling-textarea.html is confusing
Summary: Expectation of /editing/spelling/spelling-textarea.html is confusing
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Hajime Morrita
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-01 20:35 PDT by Hajime Morrita
Modified: 2010-11-04 21:59 PDT (History)
2 users (show)

See Also:


Attachments
Patch (4.91 KB, patch)
2010-11-02 01:01 PDT, Hajime Morrita
no flags Details | Formatted Diff | Diff
Patch (11.42 KB, patch)
2010-11-04 02:31 PDT, Hajime Morrita
no flags Details | Formatted Diff | Diff
Patch (11.69 KB, patch)
2010-11-04 18:32 PDT, Hajime Morrita
tkent: review+
tkent: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hajime Morrita 2010-11-01 20:35:20 PDT
the assertion function print "PASS" even if fail, that is confusing and should print "FAIL".
Comment 1 Hajime Morrita 2010-11-02 01:01:33 PDT
Created attachment 72637 [details]
Patch
Comment 2 Ryosuke Niwa 2010-11-02 01:26:55 PDT
Comment on attachment 72637 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=72637&action=review

> LayoutTests/editing/spelling/spelling-contenteditable.html:26
> +    // Test the above 'zz' is marked as misspelled.
> +    shouldBeTrue("layoutTestController.hasSpellingMarker(0, 2)");
>  }
>  
>  var successfullyParsed = true;

Does this even need to be a script test?  There seems to be only one test case in this.  We should make this a regular dump-as-text test or runDumpAsTextEditingTest test.

> LayoutTests/editing/spelling/spelling-textarea.html:23
> -    // 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));
> +    // Test the above 'zz' is marked as misspelled.
> +    shouldBeTrue("layoutTestController.hasSpellingMarker(0, 2)");

Ditto for this test as well.  You could combine these two tests into one file.  Then it's perfectly valid to keep it as a script test.
Comment 3 Hajime Morrita 2010-11-04 02:31:05 PDT
Created attachment 72918 [details]
Patch
Comment 4 Hajime Morrita 2010-11-04 02:32:54 PDT
Hi Ryosuke, thank you for taking a look!

> Does this even need to be a script test?  There seems to be only one test case in this.  We should make this a regular dump-as-text test or runDumpAsTextEditingTest test.
Make these two test into one. 
On the name spelling-hasspellingmarker, these tests are introduced to check if 
LayoutTestController.hasSpellingMarker() works. The name reflects it.
Comment 5 Ryosuke Niwa 2010-11-04 02:41:42 PDT
Comment on attachment 72918 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=72918&action=review

> LayoutTests/editing/spelling/script-tests/spelling-hasspellingmarker.js:18
> +shouldBeTrue("hasMarked(\"<input id='test' type='text'>\");");

Is this a new test?  If so, you probably say why you're adding this.

> LayoutTests/editing/spelling/script-tests/spelling-hasspellingmarker.js:20
> +shouldBeFalse("hasMarked(\"<div id='test' contentEditable='true' spellcheck='false'></div>\");");

This seems to be new as well.
Comment 6 Hajime Morrita 2010-11-04 18:32:15 PDT
Created attachment 73025 [details]
Patch
Comment 7 Hajime Morrita 2010-11-04 18:33:14 PDT
> (From update of attachment 72918 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=72918&action=review
> 
> > LayoutTests/editing/spelling/script-tests/spelling-hasspellingmarker.js:18
> > +shouldBeTrue("hasMarked(\"<input id='test' type='text'>\");");
> 
> Is this a new test?  If so, you probably say why you're adding this.
Yes, it' new for make it more comprehensive. 
I added an explanation on the ChangeLog.
Comment 8 Ryosuke Niwa 2010-11-04 18:53:00 PDT
Comment on attachment 73025 [details]
Patch

LGTM.
Comment 9 Kent Tamura 2010-11-04 21:33:48 PDT
Comment on attachment 73025 [details]
Patch

Looks good except the ChangeLog diff doesn't start at the beginning of the file.
Comment 10 Hajime Morrita 2010-11-04 21:59:10 PDT
Committed r71392: <http://trac.webkit.org/changeset/71392>