[Webkit-unassigned] [Bug 33509] selection.modify() should throw an exception if it receives invalid parameters

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Mar 11 00:53:19 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=33509





--- Comment #6 from TAMURA, Kent <tkent at chromium.org>  2010-03-11 00:53:19 PST ---
(From update of attachment 50478)

> diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
> index 9d47289..3538070 100644
> --- a/LayoutTests/ChangeLog
> +++ b/LayoutTests/ChangeLog
> @@ -1,3 +1,13 @@
> +2010-03-10  MORITA Hajime  <morrita at google.com>
> +
> +        Reviewed by NOBODY (OOPS!).
> +
> +        Selection.modify() should throw an exception if it receives invalid parameters.
> +        https://bugs.webkit.org/show_bug.cgi?id=33509
> +
> +        * editing/selection/modify-with-invalid-args-expected.txt: Added.
> +        * editing/selection/modify-with-invalid-args.html: Added.

Please add script-tests/modify-with-invalid-args.js

> +function shouldSelectionKeepUnchanged() {
> +    shouldBeTrue("sel.baseNode == target");
> +    shouldBeTrue("sel.baseOffset == baseOffset");
> +    shouldBeTrue("sel.extentNode == target");
> +    shouldBeTrue("sel.extentOffset == extentOffset");
> +}
> +
> +shouldThrow("sel.modify('no-such-alter', 'forward', 'character');", "'Error: NOT_SUPPORTED_ERR: DOM Exception 9'");
> +shouldSelectionKeepUnchanged();

I prefer:
 - change shouldSelectionKeepUnchanged() to isSelectionUnchanged(), it returns
just boolean and contains no shouldBe*()
 - replace shouldSelectionKeepUnchanged() calls with
shouldBeTrue('isSelectionUnchanged()')
This improves readability of the test result.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list