JS/C++: Added mobile token support to phone number util

git-svn-id: http://libphonenumber.googlecode.com/svn/trunk/cpp/test@619 ee073f10-1060-11df-b6a4-87a95322a99c
diff --git a/phonenumbers/geocoding/geocoding_data_test.cc b/phonenumbers/geocoding/geocoding_data_test.cc
index a3b7a19..53a02df 100644
--- a/phonenumbers/geocoding/geocoding_data_test.cc
+++ b/phonenumbers/geocoding/geocoding_data_test.cc
@@ -130,9 +130,9 @@
 }
 
 TEST(GeocodingDataTest, TestTestGeocodingData) {
-  ASSERT_EQ(2, get_test_country_calling_codes_size());
+  ASSERT_EQ(3, get_test_country_calling_codes_size());
   const int* country_calling_codes = get_test_country_calling_codes();
-  const int expected_calling_codes[] = {1, 82};
+  const int expected_calling_codes[] = {1, 54, 82};
   for (int i = 0; i < get_test_country_calling_codes_size(); ++i) {
     EXPECT_EQ(expected_calling_codes[i], country_calling_codes[i]);
   }
@@ -144,10 +144,10 @@
     EXPECT_STREQ(expected_languages[i], langs_1->available_languages[i]);
   }
 
-  ASSERT_EQ(4, get_test_prefix_language_code_pairs_size());
+  ASSERT_EQ(5, get_test_prefix_language_code_pairs_size());
   const char** language_code_pairs = get_test_prefix_language_code_pairs();
   const char* expected_language_code_pairs[] = {
-    "1_de", "1_en", "82_en", "82_ko",
+    "1_de", "1_en", "54_en", "82_en", "82_ko",
   };
   for (int i = 0; i < get_test_prefix_language_code_pairs_size(); ++i) {
     EXPECT_STREQ(expected_language_code_pairs[i], language_code_pairs[i]);
diff --git a/phonenumbers/phonenumberutil_test.cc b/phonenumbers/phonenumberutil_test.cc
index d9c766b..9347f19 100644
--- a/phonenumbers/phonenumberutil_test.cc
+++ b/phonenumbers/phonenumberutil_test.cc
@@ -1281,6 +1281,11 @@
   number.set_national_number(1155303000ULL);
   EXPECT_EQ(2, phone_util_.GetLengthOfNationalDestinationCode(number));
 
+  // An Argentinian mobile which has NDC "911".
+  number.set_country_code(54);
+  number.set_national_number(91187654321ULL);
+  EXPECT_EQ(3, phone_util_.GetLengthOfNationalDestinationCode(number));
+
   // Google Sydney, which has NDC "2".
   number.set_country_code(61);
   number.set_national_number(293744000ULL);
@@ -1320,6 +1325,20 @@
   EXPECT_EQ(4, phone_util_.GetLengthOfNationalDestinationCode(number));
 }
 
+TEST_F(PhoneNumberUtilTest, GetCountryMobileToken) {
+  int country_calling_code;
+  string mobile_token;
+
+  country_calling_code = phone_util_.GetCountryCodeForRegion(RegionCode::MX());
+  phone_util_.GetCountryMobileToken(country_calling_code, &mobile_token);
+  EXPECT_EQ("1", mobile_token);
+
+  // Country calling code for United States, which has no mobile token.
+  country_calling_code = phone_util_.GetCountryCodeForRegion(RegionCode::US());
+  phone_util_.GetCountryMobileToken(country_calling_code, &mobile_token);
+  EXPECT_EQ("", mobile_token);
+}
+
 TEST_F(PhoneNumberUtilTest, ExtractPossibleNumber) {
   // Removes preceding funky punctuation and letters but leaves the rest
   // untouched.