Bug 111321 - editing/execCommand/toggle-unlink.html needs to support different expectations
Summary: editing/execCommand/toggle-unlink.html needs to support different expectations
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 110487
  Show dependency treegraph
 
Reported: 2013-03-04 07:12 PST by Claudio Saavedra
Modified: 2013-03-05 22:45 PST (History)
3 users (show)

See Also:


Attachments
Patch (5.95 KB, patch)
2013-03-04 07:15 PST, Claudio Saavedra
no flags Details | Formatted Diff | Diff
Patch (17.98 KB, patch)
2013-03-05 03:36 PST, Claudio Saavedra
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Claudio Saavedra 2013-03-04 07:12:16 PST
Once bug 110487 is resolved, extending selection forward will yield different results depending on the platform. The test editing/execCommand/toggle-unlink.html currently doesn't support this, as the expected results are hardcoded into the script itself, redundantly.
Comment 1 Claudio Saavedra 2013-03-04 07:15:19 PST
Created attachment 191235 [details]
Patch
Comment 2 Ryosuke Niwa 2013-03-04 15:06:50 PST
Comment on attachment 191235 [details]
Patch

The right fix is to make the behavior dependent on editing behavior and set editing behavior to mac in this test.
Comment 3 Darin Adler 2013-03-04 15:07:35 PST
Comment on attachment 191235 [details]
Patch

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

> LayoutTests/ChangeLog:11
> +        (testSingleToggle): Just output the result of running the test and
> +        let the test infrastructure check whether the expectations are met
> +        or not.

We should not, then, write out the word PASS when the test may have failed.
Comment 4 Claudio Saavedra 2013-03-04 23:59:35 PST
(In reply to comment #2)
> (From update of attachment 191235 [details])
> The right fix is to make the behavior dependent on editing behavior and set editing behavior to mac in this test.

Wouldn't setting the editing behavior to Mac in this test be counter-productive? That would mean that, in this particular test, only the codepaths related to Mac would be tested, in all platforms. If the feature breaks for other platforms this test wouldn't catch it. How can that be better than having separate expectations for platforms that behave differently?
Comment 5 Ryosuke Niwa 2013-03-05 00:01:08 PST
(In reply to comment #4)
> (In reply to comment #2)
> > (From update of attachment 191235 [details] [details])
> > The right fix is to make the behavior dependent on editing behavior and set editing behavior to mac in this test.
> 
> Wouldn't setting the editing behavior to Mac in this test be counter-productive? That would mean that, in this particular test, only the codepaths related to Mac would be tested, in all platforms. If the feature breaks for other platforms this test wouldn't catch it. How can that be better than having separate expectations for platforms that behave differently?

You'll then add a new version of the test that tests Windows behavior.
Comment 6 Claudio Saavedra 2013-03-05 00:10:11 PST
(In reply to comment #5)
> (In reply to comment #4)
> > (In reply to comment #2)
> > > (From update of attachment 191235 [details] [details] [details])
> > > The right fix is to make the behavior dependent on editing behavior and set editing behavior to mac in this test.
> > 
> > Wouldn't setting the editing behavior to Mac in this test be counter-productive? That would mean that, in this particular test, only the codepaths related to Mac would be tested, in all platforms. If the feature breaks for other platforms this test wouldn't catch it. How can that be better than having separate expectations for platforms that behave differently?
> 
> You'll then add a new version of the test that tests Windows behavior.

This seems absolutely unnecessary to me. This is what different expectations per platform are for. The test shouldn't be hardcoding the expected outcome in its code. There are -expected.txt files that are meant to be used for that.
Comment 7 Ryosuke Niwa 2013-03-05 00:23:48 PST
(In reply to comment #6)
> (In reply to comment #5)
> > (In reply to comment #4)
> >
> > You'll then add a new version of the test that tests Windows behavior.
> 
> This seems absolutely unnecessary to me. This is what different expectations per platform are for. The test shouldn't be hardcoding the expected outcome in its code. There are -expected.txt files that are meant to be used for that.

That's what editing behaviors are for. We used to have all these platform-specific behaviors and it was an absolute nightmare to debug them because you needed access to that platform/port.
Comment 8 Ryosuke Niwa 2013-03-05 00:25:53 PST
Please grep setEditingBehaviors in LayoutTests/editing and see how we're testing various editing features.
Comment 9 Claudio Saavedra 2013-03-05 00:30:51 PST
(In reply to comment #8)
> Please grep setEditingBehaviors in LayoutTests/editing and see how we're testing various editing features.

I see. Then I'll add the suffix -mac.html to this test, set edditing behavior to Mac as you suggested, and add a new test for windows when landing bug 110487. Does that sound OK for you?
Comment 10 Claudio Saavedra 2013-03-05 03:36:44 PST
Created attachment 191456 [details]
Patch
Comment 11 Ryosuke Niwa 2013-03-05 10:23:47 PST
Comment on attachment 191456 [details]
Patch

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

> LayoutTests/ChangeLog:14
> +        * editing/execCommand/script-tests/toggle-unlink-mac.js: Renamed
> +        from
> +        LayoutTests/editing/execCommand/script-tests/toggle-unlink.js.
> +        Also set editing behaviour to Mac.

Why was this file not svn mv'ed?
Comment 12 Claudio Saavedra 2013-03-05 12:00:51 PST
(In reply to comment #11)
> (From update of attachment 191456 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=191456&action=review
> 
> > LayoutTests/ChangeLog:14
> > +        * editing/execCommand/script-tests/toggle-unlink-mac.js: Renamed
> > +        from
> > +        LayoutTests/editing/execCommand/script-tests/toggle-unlink.js.
> > +        Also set editing behaviour to Mac.
> 
> Why was this file not svn mv'ed?

It is, to toggle-unlink-mac.js. The ChangeLog word wrapping might be a bit confusing here.
Comment 13 Build Bot 2013-03-05 13:38:18 PST
Comment on attachment 191456 [details]
Patch

Attachment 191456 [details] did not pass mac-ews (mac):
Output: http://webkit-commit-queue.appspot.com/results/17013074

New failing tests:
editing/selection/selection-invalid-offset.html
Comment 14 Claudio Saavedra 2013-03-05 22:12:19 PST
(In reply to comment #13)
> (From update of attachment 191456 [details])
> Attachment 191456 [details] did not pass mac-ews (mac):
> Output: http://webkit-commit-queue.appspot.com/results/17013074
> 
> New failing tests:
> editing/selection/selection-invalid-offset.html

Failing test is unrelated to the patch as far as I can tell.. is it safe to commit?
Comment 15 WebKit Review Bot 2013-03-05 22:45:16 PST
Comment on attachment 191456 [details]
Patch

Clearing flags on attachment: 191456

Committed r144883: <http://trac.webkit.org/changeset/144883>
Comment 16 WebKit Review Bot 2013-03-05 22:45:19 PST
All reviewed patches have been landed.  Closing bug.