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

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

Issue 417493002: Make ui_chromeos_resources IDRs accessible via chrome://theme/<IDR>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: +test 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources_util.cc ('k') | chrome/chrome_browser.gypi » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui_resources.h" 8 #include "grit/ui_resources.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 #if defined(OS_CHROMEOS)
12 #include "grit/ui_chromeos_resources.h"
13 #endif
14
11 TEST(ResourcesUtil, SpotCheckIds) { 15 TEST(ResourcesUtil, SpotCheckIds) {
12 const struct { 16 const struct {
13 const char* name; 17 const char* name;
14 int id; 18 int id;
15 } kCases[] = { 19 } kCases[] = {
16 // IDRs from chrome/app/theme/theme_resources.grd should be valid. 20 // IDRs from chrome/app/theme/theme_resources.grd should be valid.
17 {"IDR_BACK", IDR_BACK}, 21 {"IDR_BACK", IDR_BACK},
18 {"IDR_STOP", IDR_STOP}, 22 {"IDR_STOP", IDR_STOP},
19 // IDRs from ui/resources/ui_resources.grd should be valid. 23 // IDRs from ui/resources/ui_resources.grd should be valid.
20 {"IDR_CHECKMARK", IDR_CHECKMARK}, 24 {"IDR_CHECKMARK", IDR_CHECKMARK},
21 {"IDR_THROBBER", IDR_THROBBER}, 25 {"IDR_THROBBER", IDR_THROBBER},
26 #if defined(OS_CHROMEOS)
27 // Check IDRs from ui/chromeos/resources/ui_chromeos_resources.grd.
28 {"IDR_LOGIN_DEFAULT_USER", IDR_LOGIN_DEFAULT_USER},
29 #endif
22 // Unknown names should be invalid and return -1. 30 // Unknown names should be invalid and return -1.
23 {"foobar", -1}, 31 {"foobar", -1},
24 {"backstar", -1}, 32 {"backstar", -1},
25 }; 33 };
26 34
27 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kCases); ++i) 35 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kCases); ++i)
28 EXPECT_EQ(kCases[i].id, ResourcesUtil::GetThemeResourceId(kCases[i].name)); 36 EXPECT_EQ(kCases[i].id, ResourcesUtil::GetThemeResourceId(kCases[i].name));
29 } 37 }
OLDNEW
« 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