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

Unified Diff: chrome/browser/metrics/variations/generated_resources_map_lookup_unittest.cc

Issue 370463003: Add support for variations controlled overriding UI strings to the variations service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
Index: chrome/browser/metrics/variations/generated_resources_map_lookup_unittest.cc
diff --git a/chrome/browser/metrics/variations/generated_resources_map_lookup_unittest.cc b/chrome/browser/metrics/variations/generated_resources_map_lookup_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..81c0cf3a20349494052b6bec0b5450a382087391
--- /dev/null
+++ b/chrome/browser/metrics/variations/generated_resources_map_lookup_unittest.cc
@@ -0,0 +1,25 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/metrics/variations/generated_resources_map.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace chrome_variations {
+
+TEST(GeneratedResourcesMapLookupTest, LookupNotFound) {
+ EXPECT_EQ(-1, GetResourceIndex(0));
+ 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));
+}
+
+TEST(GeneratedResourcesMapLookupTest, LookupFound) {
+ for (size_t i = 0; i < kNumResources; ++i)
+ EXPECT_EQ(kResourceIndices[i], GetResourceIndex(kResourceHashes[i]));
+}
+
+} // namespace chrome_variations

Powered by Google App Engine
This is Rietveld 408576698