From 5851f10c9565f90c0cff0e1429d560524b599f09 Mon Sep 17 00:00:00 2001 From: Ting-Yu Lin Date: Wed, 9 Nov 2016 14:14:53 +0800 Subject: [PATCH] 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 --- .../tests/marionette/test_accessiblecaret_cursor_mode.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/layout/base/tests/marionette/test_accessiblecaret_cursor_mode.py b/layout/base/tests/marionette/test_accessiblecaret_cursor_mode.py index 4ffa2bf15383..f17bd22889d3 100644 --- a/layout/base/tests/marionette/test_accessiblecaret_cursor_mode.py +++ b/layout/base/tests/marionette/test_accessiblecaret_cursor_mode.py @@ -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 . + # The content should not be inserted at the front of the . 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)