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

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

Issue 2175613004: Add code back to change the status of WebBluetooth chooser once discovery is complete (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added code back to change the status of WebBluetooth chooser once discovery is complete Created 4 years, 5 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
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/BluetoothChooserDialogTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 91405288ce0ebfc55585b72a8ed09e31b8a71cd3..696d278cd8a8d5bc0edcec66286a14018b471aaa 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/ItemChooserDialogTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/ItemChooserDialogTest.java
@@ -61,11 +61,12 @@ public class ItemChooserDialogTest extends ChromeActivityTestCaseBase<ChromeActi
SpannableString title = new SpannableString("title");
SpannableString searching = new SpannableString("searching");
SpannableString noneFound = new SpannableString("noneFound");
+ SpannableString statusActive = new SpannableString("statusActive");
SpannableString statusIdleNoneFound = new SpannableString("statusIdleNoneFound");
SpannableString statusIdleSomeFound = new SpannableString("statusIdleSomeFound");
String positiveButton = new String("positiveButton");
final ItemChooserDialog.ItemChooserLabels labels =
- new ItemChooserDialog.ItemChooserLabels(title, searching, noneFound,
+ new ItemChooserDialog.ItemChooserLabels(title, searching, noneFound, statusActive,
statusIdleNoneFound, statusIdleSomeFound, positiveButton);
ItemChooserDialog dialog = ThreadUtils.runOnUiThreadBlockingNoException(
new Callable<ItemChooserDialog>() {
@@ -134,6 +135,14 @@ public class ItemChooserDialogTest extends ChromeActivityTestCaseBase<ChromeActi
mChooserDialog.addItemToList(new ItemChooserDialog.ItemChooserRow("key", "key"));
mChooserDialog.addItemToList(new ItemChooserDialog.ItemChooserRow("key2", "key2"));
+ // Two items showing, the empty view should be no more and the button
+ // should now be enabled.
+ assertEquals(View.VISIBLE, items.getVisibility());
+ assertEquals(View.GONE, items.getEmptyView().getVisibility());
+ assertEquals("statusActive", statusView.getText().toString());
+ assertFalse(button.isEnabled());
+
+ mChooserDialog.setIdleState();
// After discovery stops the list should be visible with two items,
// it should not show the empty view and the button should not be enabled.
// The chooser should show the status idle text.
@@ -229,6 +238,8 @@ public class ItemChooserDialogTest extends ChromeActivityTestCaseBase<ChromeActi
assertEquals(itemAdapter.getItem(0), item1);
assertEquals(itemAdapter.getItem(1), item2);
+ mChooserDialog.setIdleState();
+
// Try removing an item that doesn't exist.
mChooserDialog.removeItemFromList(nonExistentItem);
assertEquals(2, itemAdapter.getCount());
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/BluetoothChooserDialogTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698