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

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

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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.h" 5 #include "chrome/browser/task_manager/task_manager.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/process_util.h" 10 #include "base/process_util.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 EXPECT_EQ(l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT), 104 EXPECT_EQ(l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT),
105 model->GetResourceNetworkUsage(0)); 105 model->GetResourceNetworkUsage(0));
106 EXPECT_EQ(ASCIIToUTF16(kZeroCPUUsage), model->GetResourceCPUUsage(0)); 106 EXPECT_EQ(ASCIIToUTF16(kZeroCPUUsage), model->GetResourceCPUUsage(0));
107 107
108 task_manager.RemoveResource(&resource2); 108 task_manager.RemoveResource(&resource2);
109 EXPECT_EQ(0, model->ResourceCount()); 109 EXPECT_EQ(0, model->ResourceCount());
110 } 110 }
111 111
112 // Tests that the model is calling Refresh() on its resources. 112 // Tests that the model is calling Refresh() on its resources.
113 TEST_F(TaskManagerTest, RefreshCalled) { 113 TEST_F(TaskManagerTest, RefreshCalled) {
114 MessageLoop loop; 114 base::MessageLoop loop;
115 TaskManager task_manager; 115 TaskManager task_manager;
116 TaskManagerModel* model = task_manager.model_; 116 TaskManagerModel* model = task_manager.model_;
117 TestResource resource; 117 TestResource resource;
118 118
119 task_manager.AddResource(&resource); 119 task_manager.AddResource(&resource);
120 ASSERT_FALSE(resource.refresh_called()); 120 ASSERT_FALSE(resource.refresh_called());
121 model->update_state_ = TaskManagerModel::TASK_PENDING; 121 model->update_state_ = TaskManagerModel::TASK_PENDING;
122 model->Refresh(); 122 model->Refresh();
123 ASSERT_TRUE(resource.refresh_called()); 123 ASSERT_TRUE(resource.refresh_called());
124 task_manager.RemoveResource(&resource); 124 task_manager.RemoveResource(&resource);
125 } 125 }
OLDNEW
« no previous file with comments | « chrome/browser/task_manager/task_manager_browsertest_util.cc ('k') | chrome/browser/themes/browser_theme_pack_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698