Closed Bug 1019441 Opened 10 years ago Closed 10 years ago

[Text Selection] Selection carets sanity test

Categories

(Core :: DOM: Selection, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla33

People

(Reporter: u459114, Assigned: TYLin)

References

Details

Attachments

(2 files, 3 obsolete files)

Create basic test for text selection.
1. editable object/ input/ text area test
   selection range check.
   pref enable/ disable test - no range selected in pref off case.
2. none-editable test
   No range selected on none-editable elements.
OS: Linux → All
Hardware: x86_64 → All
Summary: [Text Selection] Text Selection sanity test → [Text Selection] Selection carets sanity test
Depends on: 960897
Blocks: 1020725
* Extract those caret manipulating functions in test_touchcaret.py to
  selection.py, and generalize them for manipulating selection.
* Use SelectionManager in test_touchcaret.py.
* Remove unneeded </input> from test_touchcaret.html.
Attachment #8436767 - Flags: review?(mdas)
Add marionette test cases for selection carets feature in bug 987718.
Test cases target <input>, <textarea>, editable and non-editable
elements.

Run tests on browser manually:
./mach marionette-test layout/base/tests/marionette/test_seletioncarets.py

Run tests on b2g emulator manually:
./mach marionette-webapi layout/base/tests/marionette/test_seletioncarets.py

Try (Mnw, Gu): https://tbpl.mozilla.org/?tree=Try&rev=98009a80781d
Try (Mn): https://tbpl.mozilla.org/?tree=Try&rev=8408d6cb88a4
Attachment #8436774 - Flags: review?(roc)
Attachment #8436774 - Flags: review?(mdas)
Comment on attachment 8436774 [details] [diff] [review]
part 2 - Add marionette test cases for selection carets (v1)

Review of attachment 8436774 [details] [diff] [review]:
-----------------------------------------------------------------

::: layout/base/tests/marionette/test_seletioncarets.py
@@ +47,5 @@
> +
> +        # Long press the caret position. Selection carets should appear, and
> +        # select the first word.
> +        self.actions.press(el, x, y).wait(self._long_press_time)
> +        self.actions.release().perform()

Since bug 1020874 is merged, I'll use long_press() on (x, y) in next patch after receiving reviewer's comments.
Comment on attachment 8436774 [details] [diff] [review]
part 2 - Add marionette test cases for selection carets (v1)

Review of attachment 8436774 [details] [diff] [review]:
-----------------------------------------------------------------

rubber-stamp=me. I'm not familiar with marionette tests.
Attachment #8436774 - Flags: review?(roc) → review+
Comment on attachment 8436774 [details] [diff] [review]
part 2 - Add marionette test cases for selection carets (v1)

Review of attachment 8436774 [details] [diff] [review]:
-----------------------------------------------------------------

looks good! Can the test be renamed to test_selectioncarets.py? There's a missing 'c' in the filename, and manifest.ini should be updated with the new name
Attachment #8436774 - Flags: review?(mdas) → review+
Comment on attachment 8436767 [details] [diff] [review]
part 1 - Add SelectionManager in marionette (v1)

Review of attachment 8436767 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for adding selection.py! Will make peoples' lives easier :)
Attachment #8436767 - Flags: review?(mdas) → review+
(In reply to Malini Das [:mdas] from comment #5)
> Comment on attachment 8436774 [details] [diff] [review]
> part 2 - Add marionette test cases for selection carets (v1)
> 
> Review of attachment 8436774 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> looks good! Can the test be renamed to test_selectioncarets.py? There's a
> missing 'c' in the filename, and manifest.ini should be updated with the new
> name

Good catch! Will fix it.
* Change file name to test_selectioncaret.py
* Use long_press() on (x, y)

Try opt (Mnw, Gu): https://tbpl.mozilla.org/?tree=Try&rev=96375a3ed1c7
Try debug (Mn): https://tbpl.mozilla.org/?tree=Try&rev=22423b5d1bb4
Attachment #8436774 - Attachment is obsolete: true
Attachment #8438338 - Flags: review+
Keywords: checkin-needed
Blocks: 1020261
https://hg.mozilla.org/mozilla-central/rev/71b8546e8e57
https://hg.mozilla.org/mozilla-central/rev/82109f618af4
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
Fun times, this test perma-fails on Windows. Not that you would have known that because we only enabled them in production and Try today. But boy was that hilarity-making watching all trunk trees go orange in unison. I've disabled the test on Windows for now. Feel free to green it up and re-enable at your leisure.
https://hg.mozilla.org/mozilla-central/rev/3a81f39bf585

Log:
https://tbpl.mozilla.org/php/getParsedLog.php?id=41621079&tree=Mozilla-Central
Wow, it's unexpected to see all the tests failed on Windows. I've tried a nightly build on Windows. The root cause is that long press to select a word has different behavior on Windows. For example, if we have a <input> containing "abc def ghi", long press on the character 'e' selects "def" on Linux. However, on Windows, it selects "def ", i.e. the word "def" with all the spaces afterward. That's why the tests went orange.

Ryan, thanks for disabling them on Windows until we find a proper solution.
Blocks: 1024848
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: