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

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

Issue 1739523002: WebUsb Android chooser UI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 9 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 5ab4b84d03ca0395976442aefd36eeb216e801d5..e397d55e91f149a8c0300a5bd140b51789af4200 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/BluetoothChooserDialogTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/BluetoothChooserDialogTest.java
@@ -148,6 +148,15 @@ public class BluetoothChooserDialogTest extends ChromeActivityTestCaseBase<Chrom
return message.replaceAll("</?link>", "");
}
+ /**
+ * The messages include <link1> ... </link1>, <link2> ... </link2> sections
+ * that are used to create clickable spans. For testing the messages, this
+ * function returns the raw string without the tags.
+ */
+ private static String removeMultipleLinkTags(String message) {
newt (away) 2016/03/17 01:53:20 Why not combine this into the method above?
juncai 2016/03/17 18:21:35 Done.
+ return message.replaceAll("</?link1>", "").replaceAll("</?link2>", "");
+ }
+
@SmallTest
public void testCancel() throws InterruptedException {
ItemChooserDialog itemChooser = mChooserDialog.mItemChooserDialog;
@@ -202,7 +211,8 @@ public class BluetoothChooserDialogTest extends ChromeActivityTestCaseBase<Chrom
// the progress spinner should disappear, the Commit button should still
// be disabled (since nothing's selected), and the list view should
// show.
- assertEquals(removeLinkTags(getActivity().getString(R.string.bluetooth_not_seeing_it)),
+ assertEquals(removeMultipleLinkTags(getActivity().getString(
+ R.string.bluetooth_not_seeing_it_idle_some_found)),
statusView.getText().toString());
assertFalse(button.isEnabled());
assertEquals(View.VISIBLE, items.getVisibility());

Powered by Google App Engine
This is Rietveld 408576698