blob: 4bd6bd0c1b36353a67626d7d7f1f59a3ea59a36a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/theme_resources_util.h"
#include "grit/theme_resources.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
struct TestCase {
const char* name;
int id;
};
} // namespace
TEST(ThemeResourcesUtil, SpotCheckIds) {
const TestCase kTestCases[] = {
{"back", IDR_BACK},
{"go", IDR_GO},
{"star", IDR_STAR},
{"sad_tab", IDR_SAD_TAB},
};
for (size_t i = 0; i < arraysize(kTestCases); ++i) {
EXPECT_EQ(kTestCases[i].id, ThemeResourcesUtil::GetId(kTestCases[i].name));
}
// Should return -1 of unknown names.
EXPECT_EQ(-1, ThemeResourcesUtil::GetId("foobar"));
EXPECT_EQ(-1, ThemeResourcesUtil::GetId("backstar"));
}
|