| 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/chromium_strings.h" | 5 #include "grit/chromium_strings.h" |
| 6 #include "grit/generated_resources.h" | 6 #include "grit/generated_resources.h" |
| 7 #include "grit/locale_settings.h" | 7 #include "grit/locale_settings.h" |
| 8 #include "grit/ui_resources.h" | 8 #include "grit/ui_resources.h" |
| 9 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 #include "ui/base/l10n/l10n_util.h" | 11 #include "ui/base/l10n/l10n_util.h" |
| 12 | 12 |
| 13 using testing::HasSubstr; | 13 using testing::HasSubstr; |
| 14 using testing::Not; | 14 using testing::Not; |
| 15 | 15 |
| 16 void TestStringStillOkForCloudPrint(int resource_id) { | 16 void TestStringStillOkForCloudPrint(int resource_id) { |
| 17 std::string resource_string = l10n_util::GetStringUTF8(resource_id); | 17 std::string resource_string = l10n_util::GetStringUTF8(resource_id); |
| 18 EXPECT_THAT(resource_string, Not(HasSubstr("Sync"))); | 18 EXPECT_THAT(resource_string, Not(HasSubstr("Sync"))); |
| 19 EXPECT_THAT(resource_string, Not(HasSubstr("sync"))); | 19 EXPECT_THAT(resource_string, Not(HasSubstr("sync"))); |
| 20 } | 20 } |
| 21 | 21 |
| 22 // This set of strings to test was generated from | 22 // This set of strings to test was generated from |
| 23 // CloudPrintSetupSource::StartDataRequest. If any of these trip, notify the | 23 // CloudPrintSetupSource::StartDataRequest. If any of these trip, notify the |
| 24 // cloud printing team and we'll split the strings. | 24 // cloud printing team and we'll split the strings. |
| 25 TEST(CloudPrintResources, SharedStringsCheck) { | 25 TEST(CloudPrintResources, SharedStringsCheck) { |
| 26 TestStringStillOkForCloudPrint(IDS_SYNC_LOGIN_SIGNIN_PREFIX); | 26 TestStringStillOkForCloudPrint(IDS_SYNC_LOGIN_SIGNIN_PREFIX); |
| 27 TestStringStillOkForCloudPrint(IDS_SYNC_LOGIN_SIGNIN_SUFFIX); | 27 TestStringStillOkForCloudPrint(IDS_SYNC_LOGIN_SIGNIN_SUFFIX); |
| 28 TestStringStillOkForCloudPrint(IDS_SYNC_CANNOT_BE_BLANK); | 28 TestStringStillOkForCloudPrint(IDS_SYNC_CANNOT_BE_BLANK); |
| 29 TestStringStillOkForCloudPrint(IDS_SYNC_LOGIN_EMAIL); | 29 TestStringStillOkForCloudPrint(IDS_SYNC_LOGIN_EMAIL_SAME_LINE); |
| 30 TestStringStillOkForCloudPrint(IDS_SYNC_LOGIN_PASSWORD); | 30 TestStringStillOkForCloudPrint(IDS_SYNC_LOGIN_PASSWORD_SAME_LINE); |
| 31 TestStringStillOkForCloudPrint(IDS_SYNC_INVALID_USER_CREDENTIALS); | 31 TestStringStillOkForCloudPrint(IDS_SYNC_INVALID_USER_CREDENTIALS); |
| 32 TestStringStillOkForCloudPrint(IDS_SYNC_SIGNIN); | 32 TestStringStillOkForCloudPrint(IDS_SYNC_SIGNIN); |
| 33 TestStringStillOkForCloudPrint(IDS_SYNC_LOGIN_COULD_NOT_CONNECT); | 33 TestStringStillOkForCloudPrint(IDS_SYNC_LOGIN_COULD_NOT_CONNECT); |
| 34 TestStringStillOkForCloudPrint(IDS_SYNC_CANNOT_ACCESS_ACCOUNT); | 34 TestStringStillOkForCloudPrint(IDS_SYNC_CANNOT_ACCESS_ACCOUNT); |
| 35 TestStringStillOkForCloudPrint(IDS_SYNC_CREATE_ACCOUNT); | 35 TestStringStillOkForCloudPrint(IDS_SYNC_CREATE_ACCOUNT); |
| 36 TestStringStillOkForCloudPrint(IDS_SYNC_LOGIN_SETTING_UP); | 36 TestStringStillOkForCloudPrint(IDS_SYNC_LOGIN_SETTING_UP); |
| 37 TestStringStillOkForCloudPrint(IDS_SYNC_SUCCESS); | 37 TestStringStillOkForCloudPrint(IDS_SYNC_SUCCESS); |
| 38 TestStringStillOkForCloudPrint(IDS_SYNC_ERROR_SIGNING_IN); | 38 TestStringStillOkForCloudPrint(IDS_SYNC_ERROR_SIGNING_IN); |
| 39 TestStringStillOkForCloudPrint(IDS_SYNC_GAIA_CAPTCHA_INSTRUCTIONS); | 39 TestStringStillOkForCloudPrint(IDS_SYNC_GAIA_CAPTCHA_INSTRUCTIONS); |
| 40 TestStringStillOkForCloudPrint(IDS_SYNC_INVALID_ACCESS_CODE_LABEL); | 40 TestStringStillOkForCloudPrint(IDS_SYNC_INVALID_ACCESS_CODE_LABEL); |
| 41 TestStringStillOkForCloudPrint(IDS_SYNC_ENTER_ACCESS_CODE_LABEL); | 41 TestStringStillOkForCloudPrint(IDS_SYNC_ENTER_ACCESS_CODE_LABEL); |
| 42 TestStringStillOkForCloudPrint(IDS_SYNC_ACCESS_CODE_HELP_LABEL); | 42 TestStringStillOkForCloudPrint(IDS_SYNC_ACCESS_CODE_HELP_LABEL); |
| 43 TestStringStillOkForCloudPrint(IDS_SYNC_GET_ACCESS_CODE_URL); | 43 TestStringStillOkForCloudPrint(IDS_SYNC_GET_ACCESS_CODE_URL); |
| 44 TestStringStillOkForCloudPrint(IDS_SYNC_SUCCESS); | 44 TestStringStillOkForCloudPrint(IDS_SYNC_SUCCESS); |
| 45 TestStringStillOkForCloudPrint(IDS_SYNC_SETUP_OK_BUTTON_LABEL); | 45 TestStringStillOkForCloudPrint(IDS_SYNC_SETUP_OK_BUTTON_LABEL); |
| 46 } | 46 } |
| OLD | NEW |