Bug 1316040 - Change target to non-target in test_caret_not_appear_when_typing_in_scrollable_content. r=mtseng

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

--HG--
extra : rebase_source : c63b631c609992fccf350d3088bba8e0621d9a55
This commit is contained in:
Ting-Yu Lin 2016-11-09 14:14:53 +08:00
parent e7e497234b
commit 5851f10c95

View File

@ -168,7 +168,7 @@ class AccessibleCaretCursorModeTestCase(MarionetteTestCase):
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()
@ -184,10 +184,10 @@ class AccessibleCaretCursorModeTestCase(MarionetteTestCase):
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)