Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(416)

Side by Side Diff: chrome/browser/task_manager/task_manager_util_unittest.cc

Issue 137993020: (Try 2) InstantExtended: remove dead code related to the non-cacheable NTP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable InstantPolicyTests Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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/task_manager/task_manager_util.h" 5 #include "chrome/browser/task_manager/task_manager_util.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "grit/generated_resources.h" 8 #include "grit/generated_resources.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace task_manager { 11 namespace task_manager {
12 12
13 namespace util { 13 namespace util {
14 14
15 TEST(TaskManagerUtilTest, GetMessagePrefixID) { 15 TEST(TaskManagerUtilTest, GetMessagePrefixID) {
16 struct Configuration { 16 struct Configuration {
17 bool is_app; 17 bool is_app;
18 bool is_extension; 18 bool is_extension;
19 bool is_incognito; 19 bool is_incognito;
20 bool is_prerender; 20 bool is_prerender;
21 bool is_instant_overlay;
22 bool is_background; 21 bool is_background;
23 int expected_result; 22 int expected_result;
24 }; 23 };
25 const Configuration configs[] = { 24 const Configuration configs[] = {
26 // Use implicit int->bool conversion to save space and keep alignment. 25 // Use implicit int->bool conversion to save space and keep alignment.
27 {1, 0, 0, 0, 0, 1, IDS_TASK_MANAGER_BACKGROUND_PREFIX}, 26 {1, 0, 0, 0, 1, IDS_TASK_MANAGER_BACKGROUND_PREFIX},
28 {1, 0, 1, 0, 0, 0, IDS_TASK_MANAGER_APP_INCOGNITO_PREFIX}, 27 {1, 0, 1, 0, 0, IDS_TASK_MANAGER_APP_INCOGNITO_PREFIX},
29 {1, 0, 0, 0, 0, 0, IDS_TASK_MANAGER_APP_PREFIX}, 28 {1, 0, 0, 0, 0, IDS_TASK_MANAGER_APP_PREFIX},
30 {0, 1, 1, 0, 0, 0, IDS_TASK_MANAGER_EXTENSION_INCOGNITO_PREFIX}, 29 {0, 1, 1, 0, 0, IDS_TASK_MANAGER_EXTENSION_INCOGNITO_PREFIX},
31 {0, 1, 0, 0, 0, 0, IDS_TASK_MANAGER_EXTENSION_PREFIX}, 30 {0, 1, 0, 0, 0, IDS_TASK_MANAGER_EXTENSION_PREFIX},
32 {0, 0, 0, 1, 0, 0, IDS_TASK_MANAGER_PRERENDER_PREFIX}, 31 {0, 0, 0, 1, 0, IDS_TASK_MANAGER_PRERENDER_PREFIX},
33 {0, 0, 0, 0, 1, 0, IDS_TASK_MANAGER_INSTANT_OVERLAY_PREFIX}, 32 {0, 0, 1, 0, 0, IDS_TASK_MANAGER_TAB_INCOGNITO_PREFIX},
34 {0, 0, 1, 0, 0, 0, IDS_TASK_MANAGER_TAB_INCOGNITO_PREFIX}, 33 {0, 0, 0, 0, 0, IDS_TASK_MANAGER_TAB_PREFIX}};
35 {0, 0, 0, 0, 0, 0, IDS_TASK_MANAGER_TAB_PREFIX}};
36 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(configs); ++i) { 34 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(configs); ++i) {
37 EXPECT_EQ(configs[i].expected_result, 35 EXPECT_EQ(configs[i].expected_result,
38 GetMessagePrefixID(configs[i].is_app, 36 GetMessagePrefixID(configs[i].is_app,
39 configs[i].is_extension, 37 configs[i].is_extension,
40 configs[i].is_incognito, 38 configs[i].is_incognito,
41 configs[i].is_prerender, 39 configs[i].is_prerender,
42 configs[i].is_instant_overlay,
43 configs[i].is_background)); 40 configs[i].is_background));
44 } 41 }
45 } 42 }
46 43
47 } // namespace util 44 } // namespace util
48 45
49 } // namespace task_manager 46 } // namespace task_manager
OLDNEW
« no previous file with comments | « chrome/browser/task_manager/task_manager_util.cc ('k') | chrome/browser/ui/browser_instant_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698