Index: chrome/android/javatests/src/org/chromium/chrome/browser/BluetoothChooserDialogTest.java |
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/BluetoothChooserDialogTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/BluetoothChooserDialogTest.java |
index 43d7d79386bd4270729922dd597792621373ede8..b66ff743ac19508069fc643e6e6532d06a22bc3b 100644 |
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/BluetoothChooserDialogTest.java |
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/BluetoothChooserDialogTest.java |
@@ -8,6 +8,7 @@ import android.Manifest; |
import android.app.Dialog; |
import android.content.Intent; |
import android.content.pm.PackageManager; |
+import android.graphics.drawable.Drawable; |
import android.location.LocationManager; |
import android.support.test.filters.LargeTest; |
import android.test.MoreAsserts; |
@@ -52,6 +53,11 @@ public class BluetoothChooserDialogTest extends ChromeActivityTestCaseBase<Chrom |
} |
@Override |
+ Drawable getConnectedIcon() { |
+ return super.mConnectedIcon; |
+ } |
+ |
+ @Override |
void nativeOnDialogFinished( |
long nativeBluetoothChooserAndroid, int eventType, String deviceId) { |
assertEquals(nativeBluetoothChooserAndroid, mNativeBluetoothChooserDialogPtr); |
@@ -226,8 +232,8 @@ public class BluetoothChooserDialogTest extends ChromeActivityTestCaseBase<Chrom |
ThreadUtils.runOnUiThreadBlocking(new Runnable() { |
@Override |
public void run() { |
- mChooserDialog.addOrUpdateDevice("id-1", "Name 1"); |
- mChooserDialog.addOrUpdateDevice("id-2", "Name 2"); |
+ mChooserDialog.addOrUpdateDevice("id-1", "Name 1", false /* isGATTConnected */); |
+ mChooserDialog.addOrUpdateDevice("id-2", "Name 2", true /* isGATTConnected */); |
} |
}); |
@@ -241,6 +247,13 @@ public class BluetoothChooserDialogTest extends ChromeActivityTestCaseBase<Chrom |
assertEquals(View.VISIBLE, items.getVisibility()); |
assertEquals(View.GONE, progress.getVisibility()); |
+ ItemChooserDialog.ItemAdapter itemAdapter = |
+ mChooserDialog.mItemChooserDialog.getItemAdapterForTesting(); |
+ assertTrue(itemAdapter.getItem(0).hasSameContents( |
+ "id-1", "Name 1", null /* icon */, null /* iconDescription */)); |
+ assertTrue(itemAdapter.getItem(1).hasSameContents("id-2", "Name 2", |
+ mChooserDialog.getConnectedIcon(), mChooserDialog.mConnectedIconDescription)); |
+ |
selectItem(mChooserDialog, 2); |
assertEquals( |