Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / components / autofill / content / browser / wallet / wallet_items_unittest.cc
index 734f8dd..0f3493d 100644 (file)
@@ -3,7 +3,6 @@
 // found in the LICENSE file.
 
 #include "base/json/json_reader.h"
-#include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/values.h"
@@ -37,7 +36,8 @@ const char kMaskedInstrument[] =
     "    \"sorting_code\":\"sorting_code\","
     "    \"phone_number\":\"phone_number\","
     "    \"country_code\":\"US\","
-    "    \"type\":\"FULL\""
+    "    \"type\":\"FULL\","
+    "    \"language_code\":\"language_code\""
     "  },"
     "  \"status\":\"VALID\","
     "  \"object_id\":\"object_id\""
@@ -61,7 +61,8 @@ const char kMaskedInstrumentMissingStatus[] =
     "    \"postal_code\":\"postal_code\","
     "    \"sorting_code\":\"sorting_code\","
     "    \"phone_number\":\"phone_number\","
-    "    \"country_code\":\"US\""
+    "    \"country_code\":\"US\","
+    "    \"language_code\":\"language_code\""
     "  },"
     "  \"object_id\":\"object_id\","
     "  \"amex_disallowed\":true"
@@ -84,7 +85,8 @@ const char kMaskedInstrumentMissingType[] =
     "    \"postal_code\":\"postal_code\","
     "    \"sorting_code\":\"sorting_code\","
     "    \"phone_number\":\"phone_number\","
-    "    \"country_code\":\"US\""
+    "    \"country_code\":\"US\","
+    "    \"language_code\":\"language_code\""
     "  },"
     "  \"status\":\"VALID\","
     "  \"object_id\":\"object_id\""
@@ -107,7 +109,8 @@ const char kMaskedInstrumentMissingLastFourDigits[] =
     "    \"postal_code\":\"postal_code\","
     "    \"sorting_code\":\"sorting_code\","
     "    \"phone_number\":\"phone_number\","
-    "    \"country_code\":\"US\""
+    "    \"country_code\":\"US\","
+    "    \"language_code\":\"language_code\""
     "  },"
     "  \"status\":\"VALID\","
     "  \"object_id\":\"object_id\""
@@ -162,7 +165,8 @@ const char kMaskedInstrumentMissingObjectId[] =
     "    \"state\":\"state\","
     "    \"postal_code\":\"postal_code\","
     "    \"phone_number\":\"phone_number\","
-    "    \"country_code\":\"US\""
+    "    \"country_code\":\"US\","
+    "    \"language_code\":\"language_code\""
     "  },"
     "  \"status\":\"VALID\""
     "}";
@@ -230,7 +234,8 @@ const char kWalletItemsMissingGoogleTransactionId[] =
     "        \"state\":\"state\","
     "        \"postal_code\":\"postal_code\","
     "        \"phone_number\":\"phone_number\","
-    "        \"country_code\":\"US\""
+    "        \"country_code\":\"US\","
+    "        \"language_code\":\"language_code\""
     "      },"
     "      \"status\":\"VALID\","
     "      \"object_id\":\"object_id\""
@@ -253,7 +258,8 @@ const char kWalletItemsMissingGoogleTransactionId[] =
     "        \"locality_name\":\"locality_name\","
     "        \"administrative_area_name\":\"administrative_area_name\","
     "        \"postal_code_number\":\"postal_code_number\","
-    "        \"country_name_code\":\"US\""
+    "        \"country_name_code\":\"US\","
+    "        \"language_code\":\"language_code\""
     "      }"
     "    }"
     "  ],"
@@ -294,7 +300,8 @@ const char kWalletItems[] =
     "        \"sorting_code\":\"sorting_code\","
     "        \"phone_number\":\"phone_number\","
     "        \"country_code\":\"US\","
-    "        \"type\":\"FULL\""
+    "        \"type\":\"FULL\","
+    "        \"language_code\":\"language_code\""
     "      },"
     "      \"status\":\"VALID\","
     "      \"object_id\":\"object_id\""
@@ -319,7 +326,8 @@ const char kWalletItems[] =
     "        \"administrative_area_name\":\"administrative_area_name\","
     "        \"postal_code_number\":\"postal_code_number\","
     "        \"sorting_code\":\"sorting_code\","
-    "        \"country_name_code\":\"US\""
+    "        \"country_name_code\":\"US\","
+    "        \"language_code\":\"language_code\""
     "      }"
     "    }"
     "  ],"
@@ -350,6 +358,12 @@ const char kWalletItems[] =
     "      \"avatar_url_48x48\":\"https://lh3.googleusercontent.com/48.jpg\","
     "      \"avatar_url_96x96\":\"https://lh3.googleusercontent.com/96.jpg\""
     "    }"
+    "  ],"
+    "  \"allowed_shipping_spec_by_country\":"
+    "  ["
+    "    {\"country_code\":\"AC\"},"
+    "    {\"country_code\":\"AD\"},"
+    "    {\"country_code\":\"US\"}"
     "  ]";
 
 const char kRequiredLegalDocument[] =
@@ -430,7 +444,8 @@ TEST_F(WalletItemsTest, CreateMaskedInstrument) {
                   ASCIIToUTF16("postal_code"),
                   ASCIIToUTF16("sorting_code"),
                   ASCIIToUTF16("phone_number"),
-                  std::string()));
+                  std::string(),
+                  "language_code"));
   WalletItems::MaskedInstrument masked_instrument(
       ASCIIToUTF16("descriptive_name"),
       WalletItems::MaskedInstrument::VISA,
@@ -556,7 +571,8 @@ TEST_F(WalletItemsTest, CreateWalletItems) {
                   ASCIIToUTF16("postal_code"),
                   ASCIIToUTF16("sorting_code"),
                   ASCIIToUTF16("phone_number"),
-                  std::string()));
+                  std::string(),
+                  "language_code"));
   scoped_ptr<WalletItems::MaskedInstrument> masked_instrument(
       new WalletItems::MaskedInstrument(ASCIIToUTF16("descriptive_name"),
                                         WalletItems::MaskedInstrument::VISA,
@@ -578,8 +594,14 @@ TEST_F(WalletItemsTest, CreateWalletItems) {
                   ASCIIToUTF16("postal_code_number"),
                   ASCIIToUTF16("sorting_code"),
                   ASCIIToUTF16("phone_number"),
-                  "id"));
+                  "id",
+                  "language_code"));
   expected.AddAddress(shipping_address.Pass());
+
+  expected.AddAllowedShippingCountry("AC");
+  expected.AddAllowedShippingCountry("AD");
+  expected.AddAllowedShippingCountry("US");
+
   EXPECT_EQ(expected, *WalletItems::CreateWalletItems(*dict));
 
   // Now try with a legal document as well.