Bug 1374482 Part 2 - Remove x and y parameters from _test_minimum_select_one_character(). draft
authorTing-Yu Lin <tlin@mozilla.com>
Mon, 16 Oct 2017 18:12:32 +0800
changeset 681155 959abe297230b2aaa4251e96dc7e125da31d718e
parent 681149 bd1fc82d1e01a304e643fb5215e68e1b15fd4c0f
child 736104 95cb0c0301e3a4a3b315f8f75efac746baad53cf
push id84778
push userbmo:tlin@mozilla.com
push dateTue, 17 Oct 2017 02:56:19 +0000
bugs1374482
milestone58.0a1
Bug 1374482 Part 2 - Remove x and y parameters from _test_minimum_select_one_character(). They are not needed due to Part 1. MozReview-Commit-ID: DMPnidVgbOI
layout/base/tests/marionette/test_accessiblecaret_selection_mode.py
--- a/layout/base/tests/marionette/test_accessiblecaret_selection_mode.py
+++ b/layout/base/tests/marionette/test_accessiblecaret_selection_mode.py
@@ -258,38 +258,32 @@ class AccessibleCaretSelectionModeTestCa
     @parameterized(_textarea2_id, el_id=_textarea2_id)
     @parameterized(_contenteditable2_id, el_id=_contenteditable2_id)
     @parameterized(_content2_id, el_id=_content2_id)
     def test_minimum_select_one_character2(self, el_id):
         self.open_test_html(self._multipleline_html)
         el = self.marionette.find_element(By.ID, el_id)
         self._test_minimum_select_one_character(el)
 
-    def _test_minimum_select_one_character(self, el, x=None, y=None):
+    def _test_minimum_select_one_character(self, el):
         sel = SelectionManager(el)
         original_content = sel.content
         words = original_content.split()
         self.assertTrue(len(words) >= 1, 'Expect at least one word in the content.')
 
         # Get the location of the carets at the end of the content for later
         # use.
         sel.select_all()
         end_caret_x, end_caret_y = sel.second_caret_location()
         el.tap()
 
         # Goal: Select the first character.
         target_content = original_content[0]
 
-        if x and y:
-            # If we got x and y from the arguments, use it as a hint of the
-            # location of the first word
-            pass
-        else:
-            x, y = self.word_location(el, 0)
-        self.long_press_on_location(el, x, y)
+        self.long_press_on_word(el, 0)
 
         # Drag the second caret to the end of the content.
         (caret1_x, caret1_y), (caret2_x, caret2_y) = sel.carets_location()
         self.actions.flick(el, caret2_x, caret2_y, end_caret_x, end_caret_y).perform()
 
         # Drag the second caret to the position of the first caret.
         (caret1_x, caret1_y), (caret2_x, caret2_y) = sel.carets_location()
         self.actions.flick(el, caret2_x, caret2_y, caret1_x, caret1_y).perform()