Backed out changeset 218b4db3e21a (bug 1121459)

This commit is contained in:
Nigel Babu 2015-12-22 14:03:18 +05:30
parent 3f592a3002
commit b812c1ef11
3 changed files with 79 additions and 24 deletions

View File

@ -11,5 +11,5 @@ b2g = true
; true if the test should be skipped
skip = false
[test_accessiblecaret_cursor_mode.py]
[test_accessiblecaret_selection_mode.py]
[test_touchcaret.py]
[test_selectioncarets.py]

View File

@ -18,21 +18,16 @@ def skip_if_not_rotatable(target):
return wrapper
class AccessibleCaretSelectionModeTestCase(MarionetteTestCase):
'''Test cases for AccessibleCaret under selection mode, aka selection carets.
class CommonCaretsTestCase(object):
'''Common test cases for a selection with a two carets.
To run these test cases, a subclass must inherit from both this class and
MarionetteTestCase.
'''
def setUp(self):
# Code to execute before a tests are run.
super(AccessibleCaretSelectionModeTestCase, self).setUp()
self.carets_tested_pref = 'layout.accessiblecaret.enabled'
self.prefs = {
'layout.word_select.eat_space_to_next_word': False,
'layout.accessiblecaret.use_long_tap_injector': False,
self.carets_tested_pref: True,
}
self.marionette.set_prefs(self.prefs)
super(CommonCaretsTestCase, self).setUp()
self.actions = Actions(self.marionette)
def open_test_html(self):
@ -695,6 +690,31 @@ class AccessibleCaretSelectionModeTestCase(MarionetteTestCase):
self.open_test_html2()
self._test_minimum_select_one_character(self._content2, self.assertEqual)
class SelectionCaretsTestCase(CommonCaretsTestCase, MarionetteTestCase):
def setUp(self):
super(SelectionCaretsTestCase, self).setUp()
self.carets_tested_pref = 'selectioncaret.enabled'
self.prefs = {
'layout.accessiblecaret.enabled': False,
'layout.word_select.eat_space_to_next_word': False,
self.carets_tested_pref: True,
}
self.marionette.set_prefs(self.prefs)
class AccessibleCaretSelectionModeTestCase(CommonCaretsTestCase, MarionetteTestCase):
def setUp(self):
super(AccessibleCaretSelectionModeTestCase, self).setUp()
self.carets_tested_pref = 'layout.accessiblecaret.enabled'
self.prefs = {
'selectioncaret.enabled': False,
'layout.word_select.eat_space_to_next_word': False,
'layout.accessiblecaret.use_long_tap_injector': False,
self.carets_tested_pref: True,
}
self.marionette.set_prefs(self.prefs)
def test_long_press_to_select_when_partial_visible_word_is_selected(self):
self.open_test_html()
el = self._input

View File

@ -12,21 +12,16 @@ from marionette_driver.marionette import Actions
from marionette_driver.selection import SelectionManager
class AccessibleCaretCursorModeTestCase(MarionetteTestCase):
'''Test cases for AccessibleCaret under cursor mode, aka touch caret.
class CommonCaretTestCase(object):
'''Common test cases for a collapsed selection with a single caret.
To run these test cases, a subclass must inherit from both this class and
MarionetteTestCase.
'''
def setUp(self):
# Code to execute before a test is being run.
super(AccessibleCaretCursorModeTestCase, self).setUp()
self.caret_tested_pref = 'layout.accessiblecaret.enabled'
self.caret_timeout_ms_pref = 'layout.accessiblecaret.timeout_ms'
self.prefs = {
self.caret_tested_pref: True,
self.caret_timeout_ms_pref: 0,
}
self.marionette.set_prefs(self.prefs)
super(CommonCaretTestCase, self).setUp()
self.actions = Actions(self.marionette)
def timeout_ms(self):
@ -300,6 +295,46 @@ class AccessibleCaretCursorModeTestCase(MarionetteTestCase):
self.open_test_html()
self._test_move_caret_to_front_by_dragging_touch_caret_to_front_of_content(self._contenteditable, self.assertNotEqual)
class TouchCaretTestCase(CommonCaretTestCase, MarionetteTestCase):
def setUp(self):
super(TouchCaretTestCase, self).setUp()
self.caret_tested_pref = 'touchcaret.enabled'
self.caret_timeout_ms_pref = 'touchcaret.expiration.time'
self.prefs = {
'layout.accessiblecaret.enabled': False,
self.caret_tested_pref: True,
self.caret_timeout_ms_pref: 0,
}
self.marionette.set_prefs(self.prefs)
def test_input_touch_caret_hides_after_receiving_wheel_event(self):
self.open_test_html()
self._test_touch_caret_hides_after_receiving_wheel_event(self._input, self.assertNotEqual)
def test_textarea_touch_caret_hides_after_receiving_wheel_event(self):
self.open_test_html()
self._test_touch_caret_hides_after_receiving_wheel_event(self._textarea, self.assertNotEqual)
def test_contenteditable_touch_caret_hides_after_receiving_wheel_event(self):
self.open_test_html()
self._test_touch_caret_hides_after_receiving_wheel_event(self._contenteditable, self.assertNotEqual)
class AccessibleCaretCursorModeTestCase(CommonCaretTestCase, MarionetteTestCase):
def setUp(self):
super(AccessibleCaretCursorModeTestCase, self).setUp()
self.caret_tested_pref = 'layout.accessiblecaret.enabled'
self.caret_timeout_ms_pref = 'layout.accessiblecaret.timeout_ms'
self.prefs = {
'touchcaret.enabled': False,
self.caret_tested_pref: True,
self.caret_timeout_ms_pref: 0,
}
self.marionette.set_prefs(self.prefs)
def test_caret_does_not_jump_when_dragging_to_editable_content_boundary(self):
self.open_test_html()
el = self._input