blob: 763755943e3f15f21314fd032e451aabc53ac035 [file] [log] [blame]
[email protected]2a2813352012-07-11 22:20:231// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]80cc3f72009-04-24 18:06:052// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]1faee3f02010-06-21 07:01:345#include "chrome/browser/resources_util.h"
[email protected]80cc3f72009-04-24 18:06:056
7#include "grit/theme_resources.h"
[email protected]1a4cb9d2013-01-09 05:35:228#include "grit/ui_resources.h"
[email protected]80cc3f72009-04-24 18:06:059#include "testing/gtest/include/gtest/gtest.h"
10
[email protected]1faee3f02010-06-21 07:01:3411TEST(ResourcesUtil, SpotCheckIds) {
[email protected]1a4cb9d2013-01-09 05:35:2212 const struct {
13 const char* name;
14 int id;
15 } kCases[] = {
16 // IDRs from chrome/app/theme/theme_resources.grd should be valid.
[email protected]25098922010-07-01 22:43:5017 {"IDR_BACK", IDR_BACK},
18 {"IDR_STOP", IDR_STOP},
[email protected]1a4cb9d2013-01-09 05:35:2219 // IDRs from ui/resources/ui_resources.grd should be valid.
20 {"IDR_CHECKMARK", IDR_CHECKMARK},
21 {"IDR_THROBBER", IDR_THROBBER},
22 // Unknown names should be invalid and return -1.
23 {"foobar", -1},
24 {"backstar", -1},
[email protected]80cc3f72009-04-24 18:06:0525 };
[email protected]80cc3f72009-04-24 18:06:0526
[email protected]1a4cb9d2013-01-09 05:35:2227 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kCases); ++i)
28 EXPECT_EQ(kCases[i].id, ResourcesUtil::GetThemeResourceId(kCases[i].name));
[email protected]80cc3f72009-04-24 18:06:0529}