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

Unified Diff: chrome/browser/resources_util_unittest.cc

Issue 11830002: Make ui_resources IDRs accessible via chrome://theme/<IDR>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comment. Created 7 years, 11 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 | « chrome/browser/resources_util.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources_util_unittest.cc
diff --git a/chrome/browser/resources_util_unittest.cc b/chrome/browser/resources_util_unittest.cc
index dc28978b66107c36050afdb65e050d17f210652b..763755943e3f15f21314fd032e451aabc53ac035 100644
--- a/chrome/browser/resources_util_unittest.cc
+++ b/chrome/browser/resources_util_unittest.cc
@@ -5,30 +5,25 @@
#include "chrome/browser/resources_util.h"
#include "grit/theme_resources.h"
+#include "grit/ui_resources.h"
#include "testing/gtest/include/gtest/gtest.h"
-namespace {
-
-struct TestCase {
- const char* name;
- int id;
-};
-
-} // namespace
-
TEST(ResourcesUtil, SpotCheckIds) {
- const TestCase kTestCases[] = {
+ const struct {
+ const char* name;
+ int id;
+ } kCases[] = {
+ // IDRs from chrome/app/theme/theme_resources.grd should be valid.
{"IDR_BACK", IDR_BACK},
{"IDR_STOP", IDR_STOP},
- {"IDR_OMNIBOX_STAR", IDR_OMNIBOX_STAR},
- {"IDR_SAD_TAB", IDR_SAD_TAB},
+ // IDRs from ui/resources/ui_resources.grd should be valid.
+ {"IDR_CHECKMARK", IDR_CHECKMARK},
+ {"IDR_THROBBER", IDR_THROBBER},
+ // Unknown names should be invalid and return -1.
+ {"foobar", -1},
+ {"backstar", -1},
};
- for (size_t i = 0; i < arraysize(kTestCases); ++i) {
- EXPECT_EQ(kTestCases[i].id,
- ResourcesUtil::GetThemeResourceId(kTestCases[i].name));
- }
- // Should return -1 of unknown names.
- EXPECT_EQ(-1, ResourcesUtil::GetThemeResourceId("foobar"));
- EXPECT_EQ(-1, ResourcesUtil::GetThemeResourceId("backstar"));
+ for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kCases); ++i)
+ EXPECT_EQ(kCases[i].id, ResourcesUtil::GetThemeResourceId(kCases[i].name));
}
« no previous file with comments | « chrome/browser/resources_util.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698