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
{
15 TEST(TaskManagerUtilTest
, GetMessagePrefixID
) {
16 struct Configuration
{
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
));
46 } // namespace task_manager