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

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: Rebased 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..58389273f800527d4c548fb1a96180e0e6bd928d 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
@@ -16,72 +16,92 @@ public class CurrencyStringFormatterTest extends InstrumentationTestCase {
@SmallTest
public void testCad() throws Exception {
CurrencyStringFormatter formatter = new CurrencyStringFormatter("CAD", new Locale("en-US"));
- assertEquals("$5.00", formatter.format("5"));
+ assertEquals("CAD $5.00", formatter.format("5"));
}
@SmallTest
public void testAzn() throws Exception {
CurrencyStringFormatter formatter = new CurrencyStringFormatter("AZN", new Locale("en-US"));
- assertEquals("5.00", formatter.format("5"));
+ assertEquals("AZN 5.00", formatter.format("5"));
}
@SmallTest
public void testBmd() throws Exception {
CurrencyStringFormatter formatter = new CurrencyStringFormatter("BMD", new Locale("en-US"));
- assertEquals("5.00", formatter.format("5"));
+ assertEquals("BMD 5.00", formatter.format("5"));
}
@SmallTest
public void testAud() throws Exception {
CurrencyStringFormatter formatter = new CurrencyStringFormatter("AUD", new Locale("en-US"));
- assertEquals("$5.00", formatter.format("5"));
+ assertEquals("AUD $5.00", formatter.format("5"));
}
@SmallTest
public void testBzd() throws Exception {
CurrencyStringFormatter formatter = new CurrencyStringFormatter("BZD", new Locale("en-US"));
- assertEquals("5.00", formatter.format("5"));
+ assertEquals("BZD 5.00", formatter.format("5"));
}
@SmallTest
public void testClp() throws Exception {
CurrencyStringFormatter formatter = new CurrencyStringFormatter("CLP", new Locale("en-US"));
- assertEquals("5", formatter.format("5"));
+ assertEquals("CLP 5", formatter.format("5"));
}
@SmallTest
public void testLrd() throws Exception {
CurrencyStringFormatter formatter = new CurrencyStringFormatter("LRD", new Locale("en-US"));
- assertEquals("5.00", formatter.format("5"));
+ assertEquals("LRD 5.00", formatter.format("5"));
}
@SmallTest
public void testNio() throws Exception {
CurrencyStringFormatter formatter = new CurrencyStringFormatter("NIO", new Locale("en-US"));
- assertEquals("5.00", formatter.format("5"));
+ assertEquals("NIO 5.00", formatter.format("5"));
}
@SmallTest
public void testHrk() throws Exception {
CurrencyStringFormatter formatter = new CurrencyStringFormatter("HRK", new Locale("en-US"));
- assertEquals("5.00", formatter.format("5"));
+ assertEquals("HRK 5.00", formatter.format("5"));
}
@SmallTest
public void testRub() throws Exception {
CurrencyStringFormatter formatter = new CurrencyStringFormatter("RUB", new Locale("en-US"));
- assertEquals("5.00", formatter.format("5"));
+ assertEquals("RUB 5.00", formatter.format("5"));
}
@SmallTest
public void testEur() throws Exception {
CurrencyStringFormatter formatter = new CurrencyStringFormatter("EUR", new Locale("en-US"));
- assertEquals("€5.00", formatter.format("5"));
+ assertEquals("EUR €5.00", formatter.format("5"));
}
@SmallTest
public void testPkr() throws Exception {
CurrencyStringFormatter formatter = new CurrencyStringFormatter("PKR", new Locale("en-US"));
+ assertEquals("PKR 5", formatter.format("5"));
+ }
+
+ @SmallTest
+ public void testAbcdef() throws Exception {
+ CurrencyStringFormatter formatter =
+ new CurrencyStringFormatter("ABCDEF", new Locale("en-US"));
+ assertEquals("ABCDEF 5", formatter.format("5"));
+ }
+
+ @SmallTest
+ public void testAbcdefg() throws Exception {
+ CurrencyStringFormatter formatter =
+ new CurrencyStringFormatter("ABCDEFG", new Locale("en-US"));
+ assertEquals("ABCDE" + "\u2026" + " " + "5", formatter.format("5"));
+ }
+
+ @SmallTest
+ public void testEmpty() throws Exception {
+ CurrencyStringFormatter formatter = new CurrencyStringFormatter("", new Locale("en-US"));
assertEquals("5", formatter.format("5"));
}
}

Powered by Google App Engine
This is Rietveld 408576698