Chromium Code Reviews| Index: chrome/android/javatests/src/org/chromium/chrome/browser/ItemChooserDialogTest.java | 
| diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/ItemChooserDialogTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/ItemChooserDialogTest.java | 
| index c612e00a87f9287b67bc71a780f6db3d5ccbfab9..c9561524929d51763dfca0122c37f523e8f8abe4 100644 | 
| --- a/chrome/android/javatests/src/org/chromium/chrome/browser/ItemChooserDialogTest.java | 
| +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/ItemChooserDialogTest.java | 
| @@ -11,6 +11,7 @@ import android.text.SpannableString; | 
| import android.view.View; | 
| import android.widget.Button; | 
| import android.widget.ListView; | 
| +import android.widget.TextView; | 
| import org.chromium.base.ThreadUtils; | 
| import org.chromium.base.test.util.RetryOnFailure; | 
| @@ -117,6 +118,19 @@ public class ItemChooserDialogTest extends ChromeActivityTestCaseBase<ChromeActi | 
| })); | 
| } | 
| + private TextView getDescriptionTextView(Dialog dialog, int position) { | 
| + final ListView items = (ListView) dialog.findViewById(R.id.items); | 
| + CriteriaHelper.pollUiThread(new Criteria() { | 
| + @Override | 
| + public boolean isSatisfied() { | 
| + return items.getChildAt(0) != null; | 
| + } | 
| + }); | 
| + | 
| + View item = items.getChildAt(position - 1); | 
| + return (TextView) item.findViewById(R.id.description); | 
| + } | 
| + | 
| @LargeTest | 
| public void testSimpleItemSelection() { | 
| Dialog dialog = mChooserDialog.getDialogForTesting(); | 
| @@ -154,6 +168,7 @@ public class ItemChooserDialogTest extends ChromeActivityTestCaseBase<ChromeActi | 
| // Select the first item and verify it got selected. | 
| selectItem(dialog, 1, "key1", true); | 
| + assertTrue(getDescriptionTextView(dialog, 1).isSelected()); | 
| 
 
ortuno
2017/04/06 06:27:41
An initial version of this patch (see patchset #1)
 
Ted C
2017/04/10 23:35:53
Both of those bugs look to me like we aren't calli
 
 | 
| mChooserDialog.dismiss(); | 
| } |