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

Side by Side Diff: chrome/browser/task_manager_unittest.cc

Issue 140044: Reorganize the way the task manager is constructed.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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
« no previous file with comments | « chrome/browser/task_manager_linux.cc ('k') | chrome/browser/task_manager_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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.h" 5 #include "chrome/browser/task_manager.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "base/process_util.h" 10 #include "base/process_util.h"
(...skipping 15 matching lines...) Expand all
26 }; 26 };
27 27
28 } // namespace 28 } // namespace
29 29
30 class TaskManagerTest : public testing::Test { 30 class TaskManagerTest : public testing::Test {
31 }; 31 };
32 32
33 TEST_F(TaskManagerTest, Basic) { 33 TEST_F(TaskManagerTest, Basic) {
34 TaskManager task_manager; 34 TaskManager task_manager;
35 TaskManagerModel* model = task_manager.model_; 35 TaskManagerModel* model = task_manager.model_;
36 EXPECT_FALSE(task_manager.BrowserProcessIsSelected());
37 EXPECT_EQ(0, model->ResourceCount()); 36 EXPECT_EQ(0, model->ResourceCount());
38 } 37 }
39 38
40 TEST_F(TaskManagerTest, Resources) { 39 TEST_F(TaskManagerTest, Resources) {
41 TaskManager task_manager; 40 TaskManager task_manager;
42 TaskManagerModel* model = task_manager.model_; 41 TaskManagerModel* model = task_manager.model_;
43 42
44 TestResource resource1, resource2; 43 TestResource resource1, resource2;
45 44
46 task_manager.AddResource(&resource1); 45 task_manager.AddResource(&resource1);
(...skipping 18 matching lines...) Expand all
65 ASSERT_EQ(1, model->ResourceCount()); 64 ASSERT_EQ(1, model->ResourceCount());
66 EXPECT_TRUE(model->IsResourceFirstInGroup(0)); 65 EXPECT_TRUE(model->IsResourceFirstInGroup(0));
67 EXPECT_STREQ(L"test title", model->GetResourceTitle(0).c_str()); 66 EXPECT_STREQ(L"test title", model->GetResourceTitle(0).c_str());
68 EXPECT_STREQ(l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT).c_str(), 67 EXPECT_STREQ(l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT).c_str(),
69 model->GetResourceNetworkUsage(0).c_str()); 68 model->GetResourceNetworkUsage(0).c_str());
70 EXPECT_STREQ(L"0", model->GetResourceCPUUsage(0).c_str()); 69 EXPECT_STREQ(L"0", model->GetResourceCPUUsage(0).c_str());
71 70
72 task_manager.RemoveResource(&resource2); 71 task_manager.RemoveResource(&resource2);
73 EXPECT_EQ(0, model->ResourceCount()); 72 EXPECT_EQ(0, model->ResourceCount());
74 } 73 }
OLDNEW
« no previous file with comments | « chrome/browser/task_manager_linux.cc ('k') | chrome/browser/task_manager_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698