Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Unified Diff: components/variations/service/ui_string_overrider_unittest.cc

Issue 1374773002: Componentize script to generate UI string overrides mapping. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@get-resources-index
Patch Set: Rebase and fix //components/variations:unit_tests build with gn Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/variations/service/ui_string_overrider.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/variations/service/ui_string_overrider_unittest.cc
diff --git a/chrome/browser/metrics/variations/ui_string_overrider_unittest.cc b/components/variations/service/ui_string_overrider_unittest.cc
similarity index 63%
rename from chrome/browser/metrics/variations/ui_string_overrider_unittest.cc
rename to components/variations/service/ui_string_overrider_unittest.cc
index 5aace0e142f84d6cfabb73d88fb62399c9255e08..640d51ca8ced46f0e231c8a13bbf5313dde8b0cb 100644
--- a/chrome/browser/metrics/variations/ui_string_overrider_unittest.cc
+++ b/components/variations/service/ui_string_overrider_unittest.cc
@@ -4,15 +4,30 @@
#include "components/variations/service/ui_string_overrider.h"
-#include "chrome/browser/metrics/variations/generated_resources_map.h"
#include "testing/gtest/include/gtest/gtest.h"
-// TODO(sdefresne): componentize this tests as part of the resolution
-// of http://crbug.com/534257 ("Decouple iOS port from using //chrome's
-// VariationsService client").
-
namespace chrome_variations {
+namespace {
+
+const size_t kNumResources = 4;
+
+const uint32_t kResourceHashes[] = {
+ 301430091U, // IDS_BOOKMARKS_NO_ITEMS
+ 2654138887U, // IDS_BOOKMARK_BAR_IMPORT_LINK
+ 2894469061U, // IDS_BOOKMARK_GROUP_FROM_IE
+ 3847176170U, // IDS_BOOKMARK_GROUP_FROM_FIREFOX
+};
+
+const int kResourceIndices[] = {
+ 12500, // IDS_BOOKMARKS_NO_ITEMS
+ 12501, // IDS_BOOKMARK_BAR_IMPORT_LINK
+ 12502, // IDS_BOOKMARK_GROUP_FROM_IE
+ 12503, // IDS_BOOKMARK_GROUP_FROM_FIREFOX
+};
+
+} // namespace
+
class UIStringOverriderTest : public ::testing::Test {
public:
UIStringOverriderTest()
@@ -33,8 +48,8 @@ TEST_F(UIStringOverriderTest, LookupNotFound) {
EXPECT_EQ(-1, GetResourceIndex(kResourceHashes[kNumResources - 1] + 1));
// Lookup a hash that shouldn't exist.
- // 13257681U is 1 + the hash for IDS_ZOOM_NORMAL
- EXPECT_EQ(-1, GetResourceIndex(13257681U));
+ // 3847176171U is 1 + the hash for IDS_BOOKMARK_GROUP_FROM_FIREFOX.
+ EXPECT_EQ(-1, GetResourceIndex(3847176171U));
}
TEST_F(UIStringOverriderTest, LookupFound) {
« no previous file with comments | « components/variations/service/ui_string_overrider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698