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

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

Issue 2629883004: [Payment Request] Update the CurrencyStringFormatter to call the native impl. (Closed)
Patch Set: CurrencyStringFormatter -> CurrencyFormatter Created 3 years, 11 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
deleted file mode 100644
index 810a0ae01d3af1831d5e6b854a8b7e8de82d8d64..0000000000000000000000000000000000000000
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/CurrencyStringFormatterTest.java
+++ /dev/null
@@ -1,109 +0,0 @@
-// 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.support.test.filters.SmallTest;
-import android.test.InstrumentationTestCase;
-
-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"));
- }
-
- @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