Bug 1316040 - Change target to non-target in test_caret_not_appear_when_typing_in_scrollable_content.
In this test, we assume the caret does not appear at the end of the input.
However in this case, self.actions.flick() will select all text within the
input, and then send_keys() will replace it with '!'. As a result, the final
content might varies on different platforms. Test the final content match
tho target_content might not be reliable.
To fix this, we instead assert that final content does *not* match the
non_target_content as the bug occurs.
MozReview-Commit-ID: 2YRN8W3PUXG
--- a/layout/base/tests/marionette/test_accessiblecaret_cursor_mode.py
+++ b/layout/base/tests/marionette/test_accessiblecaret_cursor_mode.py
@@ -163,36 +163,36 @@ class AccessibleCaretCursorModeTestCase(
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 = '!'
- target_content = sel.content + string.ascii_letters + content_to_add
+ non_target_content = content_to_add + sel.content + string.ascii_letters
el.tap()
sel.move_cursor_to_end()
# Insert a long string to the end of the <input>, which triggers
# ScrollPositionChanged event.
el.send_keys(string.ascii_letters)
# The caret should not be visible. If it does appear wrongly due to the
# ScrollPositionChanged event, we can drag it to the front of the
# <input> to change the cursor position.
src_x, src_y = sel.first_caret_location()
dest_x, dest_y = 0, 0
self.actions.flick(el, src_x, src_y, dest_x, dest_y).perform()
- # The content should be inserted at the end of the <input>.
+ # The content should not be inserted at the front of the <input>.
el.send_keys(content_to_add)
- self.assertEqual(target_content, sel.content)
+ self.assertNotEqual(non_target_content, sel.content)
@parameterized(_input_id, el_id=_input_id)
@parameterized(_input_padding_id, el_id=_input_padding_id)
@parameterized(_textarea_one_line_id, el_id=_textarea_one_line_id)
@parameterized(_contenteditable_id, el_id=_contenteditable_id)
def test_caret_not_jump_when_dragging_to_editable_content_boundary(self, el_id):
self.open_test_html(self._cursor_html)
el = self.marionette.find_element(By.ID, el_id)