Home | History | Annotate | Download | only in cloud_print
      1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #include "grit/app_resources.h"
      6 #include "grit/chromium_strings.h"
      7 #include "grit/generated_resources.h"
      8 #include "grit/locale_settings.h"
      9 #include "testing/gtest/include/gtest/gtest.h"
     10 #include "testing/gmock/include/gmock/gmock.h"
     11 #include "ui/base/l10n/l10n_util.h"
     12 
     13 using testing::HasSubstr;
     14 using testing::Not;
     15 
     16 void TestStringStillOkForCloudPrint(int resource_id) {
     17   std::string resource_string = l10n_util::GetStringUTF8(resource_id);
     18   EXPECT_THAT(resource_string, Not(HasSubstr("Sync")));
     19   EXPECT_THAT(resource_string, Not(HasSubstr("sync")));
     20 }
     21 
     22 // This set of strings to test was generated from
     23 // CloudPrintSetupSource::StartDataRequest.  If any of these trip, notify the
     24 // cloud printing team and we'll split the strings.
     25 TEST(CloudPrintResources, SharedStringsCheck) {
     26   TestStringStillOkForCloudPrint(IDS_SYNC_LOGIN_SIGNIN_PREFIX);
     27   TestStringStillOkForCloudPrint(IDS_SYNC_LOGIN_SIGNIN_SUFFIX);
     28   TestStringStillOkForCloudPrint(IDS_SYNC_CANNOT_BE_BLANK);
     29   TestStringStillOkForCloudPrint(IDS_SYNC_LOGIN_EMAIL);
     30   TestStringStillOkForCloudPrint(IDS_SYNC_LOGIN_PASSWORD);
     31   TestStringStillOkForCloudPrint(IDS_SYNC_INVALID_USER_CREDENTIALS);
     32   TestStringStillOkForCloudPrint(IDS_SYNC_SIGNIN);
     33   TestStringStillOkForCloudPrint(IDS_SYNC_LOGIN_COULD_NOT_CONNECT);
     34   TestStringStillOkForCloudPrint(IDS_SYNC_CANNOT_ACCESS_ACCOUNT);
     35   TestStringStillOkForCloudPrint(IDS_SYNC_CREATE_ACCOUNT);
     36   TestStringStillOkForCloudPrint(IDS_SYNC_LOGIN_SETTING_UP);
     37   TestStringStillOkForCloudPrint(IDS_SYNC_SUCCESS);
     38   TestStringStillOkForCloudPrint(IDS_SYNC_ERROR_SIGNING_IN);
     39   TestStringStillOkForCloudPrint(IDS_SYNC_GAIA_CAPTCHA_INSTRUCTIONS);
     40   TestStringStillOkForCloudPrint(IDS_SYNC_INVALID_ACCESS_CODE_LABEL);
     41   TestStringStillOkForCloudPrint(IDS_SYNC_ENTER_ACCESS_CODE_LABEL);
     42   TestStringStillOkForCloudPrint(IDS_SYNC_ACCESS_CODE_HELP_LABEL);
     43   TestStringStillOkForCloudPrint(IDS_SYNC_GET_ACCESS_CODE_URL);
     44   TestStringStillOkForCloudPrint(IDS_SYNC_SUCCESS);
     45   TestStringStillOkForCloudPrint(IDS_SYNC_SETUP_OK_BUTTON_LABEL);
     46 }
     47