bluetooth: Wait for row to be removed before continuing test. |
||
Issue descriptionItemChooserDialogTest#testSelectAnItemAndRemoveAnotherItem adds three items and then removes the first and last items. In between it tests that the non-removed item stays selected but it does so before the actual rows are removed. The chooser looks like this throughout the test: +---------+ | desc1 | +---------+ | desc2 | +---------+ | desc3 | +---------+ The test should wait for the row to actually be removed before proceeding i.e. // Chooser after three items are added +---------+ | desc1 | +---------+ | desc2 | +---------+ | desc3 | +---------+ // Chooser in test after first item is removed. +---------+ | desc2 | +---------+ | desc3 | +---------+ // Chooser in test after last item is removed. +---------+ | desc2 | +---------+
,
Apr 4 2018
ortuno@, do you mean that we need to wait for the UI to redraw before testing the state? Is there an Android SDK function for that?
,
Apr 5 2018
I think it's more about the state of the list being updated. IIRC I was trying to test that "desc2" had the correct icon after "desc1" was removed. To retrieve the icon we use `getRowView(Dialog dialog, int position)`, but since we don't wait for the list to be updated, getRowView(dialog, 1), which should retrieve desc2's icon was retrieving desc1's icon. (we use 1-based numbering)
,
Apr 5 2018
We update the list items themselves synchronously. Does waiting for the icon to change require pumping the UI loop or something?
,
Apr 6 2018
Right, we update our model of the list synchronously but I don't think we update the views themselves synchronously. Other tests I've seen usually wait on the state of one of the views to change before proceeding e.g. https://cs.chromium.org/chromium/src/chrome/android/javatests/src/org/chromium/chrome/browser/ItemChooserDialogTest.java?l=122 |
||
►
Sign in to add a comment |
||
Comment 1 by sheriffbot@chromium.org
, Apr 4 2018Status: Untriaged (was: Available)