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

Side by Side Diff: chrome/browser/resources_util_unittest.cc

Issue 6849030: Add support for multi resolution icons (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added comments Created 9 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources_util.cc ('k') | chrome/browser/themes/browser_theme_pack.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/resources_util.h" 5 #include "chrome/browser/resources_util.h"
6 6
7 #include "grit/theme_resources.h" 7 #include "grit/theme_resources.h"
8 #include "grit/theme_resources_standard.h"
8 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
9 10
10 namespace { 11 namespace {
11 12
12 struct TestCase { 13 struct TestCase {
13 const char* name; 14 const char* name;
14 int id; 15 int id;
15 }; 16 };
16 17
17 } // namespace 18 } // namespace
18 19
19 TEST(ResourcesUtil, SpotCheckIds) { 20 TEST(ResourcesUtil, SpotCheckIds) {
20 const TestCase kTestCases[] = { 21 const TestCase kTestCases[] = {
21 {"IDR_BACK", IDR_BACK}, 22 {"IDR_BACK", IDR_BACK},
22 {"IDR_STOP", IDR_STOP}, 23 {"IDR_STOP", IDR_STOP},
23 {"IDR_OMNIBOX_STAR", IDR_OMNIBOX_STAR}, 24 {"IDR_OMNIBOX_STAR", IDR_OMNIBOX_STAR},
24 {"IDR_SAD_TAB", IDR_SAD_TAB}, 25 {"IDR_SAD_TAB", IDR_SAD_TAB},
25 }; 26 };
26 for (size_t i = 0; i < arraysize(kTestCases); ++i) { 27 for (size_t i = 0; i < arraysize(kTestCases); ++i) {
27 EXPECT_EQ(kTestCases[i].id, 28 EXPECT_EQ(kTestCases[i].id,
28 ResourcesUtil::GetThemeResourceId(kTestCases[i].name)); 29 ResourcesUtil::GetThemeResourceId(kTestCases[i].name));
29 } 30 }
30 31
31 // Should return -1 of unknown names. 32 // Should return -1 of unknown names.
32 EXPECT_EQ(-1, ResourcesUtil::GetThemeResourceId("foobar")); 33 EXPECT_EQ(-1, ResourcesUtil::GetThemeResourceId("foobar"));
33 EXPECT_EQ(-1, ResourcesUtil::GetThemeResourceId("backstar")); 34 EXPECT_EQ(-1, ResourcesUtil::GetThemeResourceId("backstar"));
34 } 35 }
OLDNEW
« no previous file with comments | « chrome/browser/resources_util.cc ('k') | chrome/browser/themes/browser_theme_pack.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698