Bug 1347047 Part 1 - Remove touch caret timeout test. draft
authorAstley Chen <aschen@mozilla.com>
Fri, 17 Mar 2017 08:47:02 +0800
changeset 500303 818e3b2706f3bbaa256fc47570e111b4571c9848
parent 500240 39607304b774591fa6e32c4b06158d869483c312
child 500304 4710675633bba9ea81cf4d27fe93c9585ee751b5
push id49678
push useraschen@mozilla.com
push dateFri, 17 Mar 2017 00:51:50 +0000
bugs1347047
milestone55.0a1
Bug 1347047 Part 1 - Remove touch caret timeout test. MozReview-Commit-ID: 5fVdwVfcxaz
layout/base/tests/marionette/test_accessiblecaret_cursor_mode.py
--- a/layout/base/tests/marionette/test_accessiblecaret_cursor_mode.py
+++ b/layout/base/tests/marionette/test_accessiblecaret_cursor_mode.py
@@ -30,21 +30,19 @@ class AccessibleCaretCursorModeTestCase(
 
     # Test html files.
     _cursor_html = 'test_carets_cursor.html'
 
     def setUp(self):
         # Code to execute before every test is running.
         super(AccessibleCaretCursorModeTestCase, self).setUp()
         self.caret_tested_pref = 'layout.accessiblecaret.enabled'
-        self.caret_timeout_ms_pref = 'layout.accessiblecaret.timeout_ms'
         self.hide_carets_for_mouse = 'layout.accessiblecaret.hide_carets_for_mouse_input'
         self.prefs = {
             self.caret_tested_pref: True,
-            self.caret_timeout_ms_pref: 0,
             self.hide_carets_for_mouse: False,
         }
         self.marionette.set_prefs(self.prefs)
         self.actions = Actions(self.marionette)
 
     def open_test_html(self, test_html):
         self.marionette.navigate(self.marionette.absolute_url(test_html))
 
@@ -125,50 +123,16 @@ class AccessibleCaretCursorModeTestCase(
         src_x, src_y = sel.first_caret_location()
 
         # Move first caret to the front of the input box.
         self.actions.flick(el, src_x, src_y, dest_x, dest_y).perform()
 
         self.actions.key_down(content_to_add).key_up(content_to_add).perform()
         self.assertEqual(target_content, sel.content)
 
-    @parameterized(_input_id, el_id=_input_id)
-    @parameterized(_textarea_id, el_id=_textarea_id)
-    @parameterized(_contenteditable_id, el_id=_contenteditable_id)
-    def test_dragging_caret_to_top_left_corner_after_timeout(self, el_id):
-        self.open_test_html(self._cursor_html)
-        el = self.marionette.find_element(By.ID, el_id)
-        sel = SelectionManager(el)
-        content_to_add = '!'
-        non_target_content = content_to_add + sel.content
-
-        # Set caret timeout to be 1 second.
-        timeout = 1
-        self.marionette.set_pref(self.caret_timeout_ms_pref, timeout * 1000)
-
-        # Set a 3x timeout margin to prevent intermittent test failures.
-        timeout *= 3
-
-        # Tap to make first caret appear. Note: it's strange that when the caret
-        # is at the end, the rect of the caret in <textarea> cannot be obtained.
-        # A bug perhaps.
-        el.tap()
-        sel.move_cursor_to_end()
-        sel.move_cursor_by_offset(1, backward=True)
-        el.tap(*sel.cursor_location())
-
-        # Wait until first caret disappears, then pretend to move it to the
-        # top-left corner of the input box.
-        src_x, src_y = sel.first_caret_location()
-        dest_x, dest_y = 0, 0
-        self.actions.wait(timeout).flick(el, src_x, src_y, dest_x, dest_y).perform()
-
-        self.actions.key_down(content_to_add).key_up(content_to_add).perform()
-        self.assertNotEqual(non_target_content, sel.content)
-
     def test_caret_not_appear_when_typing_in_scrollable_content(self):
         self.open_test_html(self._cursor_html)
         el = self.marionette.find_element(By.ID, self._input_id)
         sel = SelectionManager(el)
         content_to_add = '!'
         non_target_content = content_to_add + sel.content + string.ascii_letters
 
         el.tap()