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

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

Issue 2821973003: bluetooth: Add RSSI icon for bluetooth choosers. (Closed)
Patch Set: #757575 -> @color/google_grey_600 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/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 8d62138855e1226ba207843fc12d2b3755aa7759..7055c591b62f3c69b320a315914204f4577ac57d 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/BluetoothChooserDialogTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/BluetoothChooserDialogTest.java
@@ -226,8 +226,18 @@ public class BluetoothChooserDialogTest extends ChromeActivityTestCaseBase<Chrom
ThreadUtils.runOnUiThreadBlocking(new Runnable() {
@Override
public void run() {
- mChooserDialog.addOrUpdateDevice("id-1", "Name 1", false /* isGATTConnected */);
- mChooserDialog.addOrUpdateDevice("id-2", "Name 2", true /* isGATTConnected */);
+ // Add non-connected device with no signal strength.
+ mChooserDialog.addOrUpdateDevice("id-1", "Name 1", false /* isGATTConnected */,
+ -1 /* signalStrengthLevel */);
+ // Add connected device with no signal strength.
+ mChooserDialog.addOrUpdateDevice(
+ "id-2", "Name 2", true /* isGATTConnected */, -1 /* signalStrengthLevel */);
+ // Add non-connected device with signal strength level 1.
+ mChooserDialog.addOrUpdateDevice(
+ "id-3", "Name 3", false /* isGATTConnected */, 1 /* signalStrengthLevel */);
+ // Add connected device with signal strength level 1.
+ mChooserDialog.addOrUpdateDevice(
+ "id-4", "Name 4", true /* isGATTConnected */, 1 /* signalStrengthLevel */);
}
});
@@ -247,6 +257,13 @@ public class BluetoothChooserDialogTest extends ChromeActivityTestCaseBase<Chrom
"id-1", "Name 1", null /* icon */, null /* iconDescription */));
assertTrue(itemAdapter.getItem(1).hasSameContents("id-2", "Name 2",
mChooserDialog.mConnectedIcon, mChooserDialog.mConnectedIconDescription));
+ assertTrue(itemAdapter.getItem(2).hasSameContents("id-3", "Name 3",
+ mChooserDialog.mSignalStrengthLevelIcon[1],
+ getActivity().getResources().getQuantityString(
+ R.plurals.signal_strength_level_n_bars, 1, 1)));
+ // We show the connected icon even if the device has a signal strength.
+ assertTrue(itemAdapter.getItem(3).hasSameContents("id-4", "Name 4",
+ mChooserDialog.mConnectedIcon, mChooserDialog.mConnectedIconDescription));
selectItem(mChooserDialog, 2);
« no previous file with comments | « chrome/android/java/strings/android_chrome_strings.grd ('k') | chrome/browser/ui/android/bluetooth_chooser_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698