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()); |
+ } |
} |