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

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

Issue 2250313002: Show Canadian dollars as"CAD $5.00" instead of "CAD CA$5.00". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use 'new Locale' constructor instead of 'Locale.forLanguageTag' static method. Created 4 years, 4 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/java_sources.gni ('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/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
new file mode 100644
index 0000000000000000000000000000000000000000..a0b227e3c4227e2cc36596e23ae22854fbba3853
--- /dev/null
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/CurrencyStringFormatterTest.java
@@ -0,0 +1,87 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.payments;
+
+import android.test.InstrumentationTestCase;
+import android.test.suitebuilder.annotation.SmallTest;
+
+import java.util.Locale;
+
+/**
+ * A lightweight integration test for CurrencyStringFormatter to run on an Android device.
+ */
+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"));
+ }
+
+ @SmallTest
+ public void testAzn() throws Exception {
+ CurrencyStringFormatter formatter = new CurrencyStringFormatter("AZN", new Locale("en-US"));
+ assertEquals("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"));
+ }
+
+ @SmallTest
+ public void testAud() throws Exception {
+ CurrencyStringFormatter formatter = new CurrencyStringFormatter("AUD", new Locale("en-US"));
+ assertEquals("$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"));
+ }
+
+ @SmallTest
+ public void testClp() throws Exception {
+ CurrencyStringFormatter formatter = new CurrencyStringFormatter("CLP", new Locale("en-US"));
+ assertEquals("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"));
+ }
+
+ @SmallTest
+ public void testNio() throws Exception {
+ CurrencyStringFormatter formatter = new CurrencyStringFormatter("NIO", new Locale("en-US"));
+ assertEquals("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"));
+ }
+
+ @SmallTest
+ public void testRub() throws Exception {
+ CurrencyStringFormatter formatter = new CurrencyStringFormatter("RUB", new Locale("en-US"));
+ assertEquals("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"));
+ }
+
+ @SmallTest
+ public void testPkr() throws Exception {
+ CurrencyStringFormatter formatter = new CurrencyStringFormatter("PKR", new Locale("en-US"));
+ assertEquals("5", formatter.format("5"));
+ }
+}
« no previous file with comments | « chrome/android/java_sources.gni ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698