Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(962)

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/ItemChooserDialogTest.java

Issue 2800563003: bluetooth: Use state_selected for changing text color and mark the TextView as selected. (Closed)
Patch Set: moar clean up Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();
}

Powered by Google App Engine
This is Rietveld 408576698