OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util.h" | 5 #include "app/l10n_util.h" |
6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
7 #include "chrome/browser/views/generic_info_view.h" | 7 #include "chrome/browser/views/generic_info_view.h" |
8 #include "grit/chromium_strings.h" | 8 #include "grit/chromium_strings.h" |
9 #include "grit/generated_resources.h" | 9 #include "grit/generated_resources.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 EXPECT_TRUE(view1->value_views_[0]->text().empty()); | 49 EXPECT_TRUE(view1->value_views_[0]->text().empty()); |
50 | 50 |
51 // Test setting values by localized string id. | 51 // Test setting values by localized string id. |
52 static int kNameIds[] = { | 52 static int kNameIds[] = { |
53 IDS_PRODUCT_NAME, | 53 IDS_PRODUCT_NAME, |
54 IDS_PRODUCT_DESCRIPTION | 54 IDS_PRODUCT_DESCRIPTION |
55 }; | 55 }; |
56 GenericInfoView* view2 = new GenericInfoView(ARRAYSIZE(kNameIds), kNameIds); | 56 GenericInfoView* view2 = new GenericInfoView(ARRAYSIZE(kNameIds), kNameIds); |
57 root_view->AddChildView(view2); | 57 root_view->AddChildView(view2); |
58 | 58 |
59 string16 product_name = l10n_util::GetString(IDS_PRODUCT_NAME); | 59 string16 product_name = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); |
60 string16 product_desc = l10n_util::GetString(IDS_PRODUCT_DESCRIPTION); | 60 string16 product_desc = l10n_util::GetStringUTF16(IDS_PRODUCT_DESCRIPTION); |
61 EXPECT_EQ(product_name, view2->name_views_[0]->GetText()); | 61 EXPECT_EQ(product_name, view2->name_views_[0]->GetText()); |
62 EXPECT_EQ(product_desc, view2->name_views_[1]->GetText()); | 62 EXPECT_EQ(product_desc, view2->name_views_[1]->GetText()); |
63 window->CloseNow(); | 63 window->CloseNow(); |
64 } | 64 } |
65 #endif // OS_WIN | 65 #endif // OS_WIN |
OLD | NEW |