Revert of Add button to add new FSP services to Files app. (patchset #8 id:140001...
[chromium-blink-merge.git] / chrome / browser / task_manager / task_manager_util_unittest.cc
blobb25bfc1153ef059d361304110b843a4ef9d7a229
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/task_manager/task_manager_util.h"
7 #include "base/basictypes.h"
8 #include "chrome/grit/generated_resources.h"
9 #include "testing/gtest/include/gtest/gtest.h"
11 namespace task_manager {
13 namespace util {
15 TEST(TaskManagerUtilTest, GetMessagePrefixID) {
16 struct Configuration {
17 bool is_app;
18 bool is_extension;
19 bool is_incognito;
20 bool is_prerender;
21 bool is_background;
22 int expected_result;
24 const Configuration configs[] = {
25 // Use implicit int->bool conversion to save space and keep alignment.
26 {1, 0, 0, 0, 1, IDS_TASK_MANAGER_BACKGROUND_PREFIX},
27 {1, 0, 1, 0, 0, IDS_TASK_MANAGER_APP_INCOGNITO_PREFIX},
28 {1, 0, 0, 0, 0, IDS_TASK_MANAGER_APP_PREFIX},
29 {0, 1, 1, 0, 0, IDS_TASK_MANAGER_EXTENSION_INCOGNITO_PREFIX},
30 {0, 1, 0, 0, 0, IDS_TASK_MANAGER_EXTENSION_PREFIX},
31 {0, 0, 0, 1, 0, IDS_TASK_MANAGER_PRERENDER_PREFIX},
32 {0, 0, 1, 0, 0, IDS_TASK_MANAGER_TAB_INCOGNITO_PREFIX},
33 {0, 0, 0, 0, 0, IDS_TASK_MANAGER_TAB_PREFIX}};
34 for (size_t i = 0; i < arraysize(configs); ++i) {
35 EXPECT_EQ(configs[i].expected_result,
36 GetMessagePrefixID(configs[i].is_app,
37 configs[i].is_extension,
38 configs[i].is_incognito,
39 configs[i].is_prerender,
40 configs[i].is_background));
44 } // namespace util
46 } // namespace task_manager