| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "grit/generated_resources.h" | 5 #include "grit/generated_resources.h" |
| 6 #include "testing/gmock/include/gmock/gmock.h" | 6 #include "testing/gmock/include/gmock/gmock.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 #include "ui/base/l10n/l10n_util.h" | 8 #include "ui/base/l10n/l10n_util.h" |
| 9 | 9 |
| 10 using testing::HasSubstr; | 10 using testing::HasSubstr; |
| 11 using testing::Not; | 11 using testing::Not; |
| 12 | 12 |
| 13 void TestStringStillOkForEnterpriseEnrollment(int resource_id) { | 13 void TestStringStillOkForEnterpriseEnrollment(int resource_id) { |
| 14 std::string resource_string = l10n_util::GetStringUTF8(resource_id); | 14 std::string resource_string = l10n_util::GetStringUTF8(resource_id); |
| 15 EXPECT_THAT(resource_string, Not(HasSubstr("Sync"))); | 15 EXPECT_THAT(resource_string, Not(HasSubstr("Sync"))); |
| 16 EXPECT_THAT(resource_string, Not(HasSubstr("sync"))); | 16 EXPECT_THAT(resource_string, Not(HasSubstr("sync"))); |
| 17 } | 17 } |
| 18 | 18 |
| 19 // This set of strings to test was generated from | 19 // This set of strings to test was generated from |
| 20 // CloudPrintSetupSource::StartDataRequest. If any of these trip, notify the | 20 // CloudPrintSetupSource::StartDataRequest. If any of these trip, notify the |
| 21 // cloud printing team and we'll split the strings. | 21 // cloud printing team and we'll split the strings. |
| 22 TEST(EnterpriseEnrollmentResources, SharedStringsCheck) { | 22 TEST(EnterpriseEnrollmentResources, SharedStringsCheck) { |
| 23 TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_LOGIN_SIGNIN_PREFIX); | 23 TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_LOGIN_SIGNIN_PREFIX); |
| 24 TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_LOGIN_SIGNIN_SUFFIX); | 24 TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_LOGIN_SIGNIN_SUFFIX); |
| 25 TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_CANNOT_BE_BLANK); | 25 TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_CANNOT_BE_BLANK); |
| 26 TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_LOGIN_EMAIL); | 26 TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_LOGIN_EMAIL_SAME_LINE); |
| 27 TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_LOGIN_PASSWORD); | 27 TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_LOGIN_PASSWORD_SAME_LINE); |
| 28 TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_INVALID_USER_CREDENTIALS); | 28 TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_INVALID_USER_CREDENTIALS); |
| 29 TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_SIGNIN); | 29 TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_SIGNIN); |
| 30 TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_LOGIN_COULD_NOT_CONNECT); | 30 TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_LOGIN_COULD_NOT_CONNECT); |
| 31 TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_LOGIN_SETTING_UP); | 31 TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_LOGIN_SETTING_UP); |
| 32 TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_SUCCESS); | 32 TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_SUCCESS); |
| 33 TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_ERROR_SIGNING_IN); | 33 TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_ERROR_SIGNING_IN); |
| 34 TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_GAIA_CAPTCHA_INSTRUCTIONS); | 34 TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_GAIA_CAPTCHA_INSTRUCTIONS); |
| 35 TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_INVALID_ACCESS_CODE_LABEL); | 35 TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_INVALID_ACCESS_CODE_LABEL); |
| 36 TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_ENTER_ACCESS_CODE_LABEL); | 36 TestStringStillOkForEnterpriseEnrollment(IDS_SYNC_ENTER_ACCESS_CODE_LABEL); |
| 37 } | 37 } |
| OLD | NEW |