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

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

Issue 2281913002: Currency code exceeding 6 chars will be ellipsized. (Closed)
Patch Set: Added comments Created 4 years, 3 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/payments/CurrencyStringFormatterTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/CurrencyStringFormatterTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/CurrencyStringFormatterTest.java
index a0b227e3c4227e2cc36596e23ae22854fbba3853..9e1acab4910f633056953f1fb40eb3ec5fffd5cc 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/CurrencyStringFormatterTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/CurrencyStringFormatterTest.java
@@ -84,4 +84,26 @@ public class CurrencyStringFormatterTest extends InstrumentationTestCase {
CurrencyStringFormatter formatter = new CurrencyStringFormatter("PKR", new Locale("en-US"));
assertEquals("5", formatter.format("5"));
}
+
+ @SmallTest
+ public void testCurrency6Chars() throws Exception {
+ CurrencyStringFormatter formatter =
+ new CurrencyStringFormatter("ABCDEF", new Locale("en-US"));
+ assertEquals("ABCDEF", formatter.getFormattedCurrencyCode());
+ }
+
+ @SmallTest
+ public void testCurrencyEllipsized() throws Exception {
+ CurrencyStringFormatter formatter =
+ new CurrencyStringFormatter("ABCDEFG", new Locale("en-US"));
+ // Currency code more than 6 character is formatted to first 5 characters and ellipsis.
+ // "\u2026" is unicode for ellipsis.
+ assertEquals("ABCDE\u2026", formatter.getFormattedCurrencyCode());
+ }
+
+ @SmallTest
+ public void testCurrencyEmpty() throws Exception {
+ CurrencyStringFormatter formatter = new CurrencyStringFormatter("", new Locale("en-US"));
+ assertEquals("", formatter.getFormattedCurrencyCode());
+ }
}

Powered by Google App Engine
This is Rietveld 408576698