Home | History | Annotate | Download | only in chromeos
      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/generated_resources.h"
      6 #include "testing/gmock/include/gmock/gmock.h"
      7 #include "testing/gtest/include/gtest/gtest.h"
      8 #include "ui/base/l10n/l10n_util.h"
      9 
     10 using testing::HasSubstr;
     11 using testing::Not;
     12 
     13 void TestStringStillOkForEnterpriseEnrollment(int resource_id) {
     14   std::string resource_string = l10n_util::GetStringUTF8(resource_id);
     15   EXPECT_THAT(resource_string, Not(HasSubstr("Sync")));
     16   EXPECT_THAT(resource_string, Not(HasSubstr("sync")));
     17 }
     18 
     19 // This set of strings to test was generated from
     20 // CloudPrintSetupSource::StartDataRequest.  If any of these trip, notify the
     21 // cloud printing team and we'll split the strings.
     22 TEST(EnterpriseEnrollmentResources, SharedStringsCheck) {
     23   TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_LOGIN_SIGNIN_PREFIX);
     24   TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_LOGIN_SIGNIN_SUFFIX);
     25   TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_CANNOT_BE_BLANK);
     26   TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_LOGIN_EMAIL);
     27   TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_LOGIN_PASSWORD);
     28   TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_INVALID_USER_CREDENTIALS);
     29   TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_SIGNIN);
     30   TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_LOGIN_COULD_NOT_CONNECT);
     31   TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_LOGIN_SETTING_UP);
     32   TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_SUCCESS);
     33   TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_ERROR_SIGNING_IN);
     34   TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_GAIA_CAPTCHA_INSTRUCTIONS);
     35   TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_INVALID_ACCESS_CODE_LABEL);
     36   TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_ENTER_ACCESS_CODE_LABEL);
     37 }
     38