| OLD | NEW |
| 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 "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #include "ui/resources/grit/ui_resources.h" | 9 #include "ui/resources/grit/ui_resources.h" |
| 10 | 10 |
| 11 #if defined(OS_CHROMEOS) | 11 #if defined(OS_CHROMEOS) |
| 12 #include "grit/ui_chromeos_resources.h" | 12 #include "grit/ui_chromeos_resources.h" |
| 13 #endif | 13 #endif |
| 14 | 14 |
| 15 TEST(ResourcesUtil, SpotCheckIds) { | 15 TEST(ResourcesUtil, SpotCheckIds) { |
| 16 const struct { | 16 const struct { |
| 17 const char* name; | 17 const char* name; |
| 18 int id; | 18 int id; |
| 19 } kCases[] = { | 19 } kCases[] = { |
| 20 // IDRs from chrome/app/theme/theme_resources.grd should be valid. | 20 // IDRs from chrome/app/theme/theme_resources.grd should be valid. |
| 21 {"IDR_INFOBAR_COOKIE", IDR_INFOBAR_COOKIE}, | 21 {"IDR_INFOBAR_COOKIE", IDR_INFOBAR_COOKIE}, |
| 22 {"IDR_PAGEINFO_BAD", IDR_PAGEINFO_BAD}, | 22 {"IDR_PAGEINFO_BAD", IDR_PAGEINFO_BAD}, |
| 23 // IDRs from ui/resources/ui_resources.grd should be valid. | 23 // IDRs from ui/resources/ui_resources.grd should be valid. |
| 24 {"IDR_FOLDER_CLOSED", IDR_FOLDER_CLOSED}, | 24 {"IDR_CHECKMARK", IDR_CHECKMARK}, |
| 25 #if defined(OS_CHROMEOS) | 25 #if defined(OS_CHROMEOS) |
| 26 // Check IDRs from ui/chromeos/resources/ui_chromeos_resources.grd. | 26 // Check IDRs from ui/chromeos/resources/ui_chromeos_resources.grd. |
| 27 {"IDR_LOGIN_DEFAULT_USER", IDR_LOGIN_DEFAULT_USER}, | 27 {"IDR_LOGIN_DEFAULT_USER", IDR_LOGIN_DEFAULT_USER}, |
| 28 #endif | 28 #endif |
| 29 // Unknown names should be invalid and return -1. | 29 // Unknown names should be invalid and return -1. |
| 30 {"foobar", -1}, | 30 {"foobar", -1}, |
| 31 {"backstar", -1}, | 31 {"backstar", -1}, |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 for (size_t i = 0; i < arraysize(kCases); ++i) | 34 for (size_t i = 0; i < arraysize(kCases); ++i) |
| 35 EXPECT_EQ(kCases[i].id, ResourcesUtil::GetThemeResourceId(kCases[i].name)); | 35 EXPECT_EQ(kCases[i].id, ResourcesUtil::GetThemeResourceId(kCases[i].name)); |
| 36 } | 36 } |
| OLD | NEW |