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

Unified Diff: chrome/browser/task_management/task_manager_test_util.cc

Issue 1374283003: Reporting top cpu and memory consumers via rappor on chromeos (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: browser/gpu stats by UMA histograms, buckets for cpu cores. Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/task_management/task_manager_test_util.cc
diff --git a/chrome/browser/task_management/task_manager_test_util.cc b/chrome/browser/task_management/task_manager_test_util.cc
new file mode 100644
index 0000000000000000000000000000000000000000..84b38c7948ba294885760a64f073225e249a2d04
--- /dev/null
+++ b/chrome/browser/task_management/task_manager_test_util.cc
@@ -0,0 +1,131 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/task_management/task_manager_test_util.h"
+
+namespace task_management {
+
+TestTaskManager::TestTaskManager()
+ : handle_(base::kNullProcessHandle),
+ pid_(base::kNullProcessId) {
+ set_timer_for_testing(scoped_ptr<base::Timer>(new base::MockTimer(true,
+ true)));
+}
+
+TestTaskManager::~TestTaskManager() {
+}
+
+// task_management::TaskManagerInterface:
+void TestTaskManager::ActivateTask(TaskId task_id) {
+}
+
+double TestTaskManager::GetCpuUsage(TaskId task_id) const {
+ return 0.0;
+}
+
+int64 TestTaskManager::GetPhysicalMemoryUsage(TaskId task_id) const {
+ return -1;
+}
+
+int64 TestTaskManager::GetPrivateMemoryUsage(TaskId task_id) const {
+ return -1;
+}
+
+int64 TestTaskManager::GetSharedMemoryUsage(TaskId task_id) const {
+ return -1;
+}
+
+int64 TestTaskManager::GetGpuMemoryUsage(TaskId task_id,
+ bool* has_duplicates) const {
+ return -1;
+}
+
+int TestTaskManager::GetIdleWakeupsPerSecond(TaskId task_id) const {
+ return -1;
+}
+
+int TestTaskManager::GetNaClDebugStubPort(TaskId task_id) const {
+ return -1;
+}
+
+void TestTaskManager::GetGDIHandles(TaskId task_id,
+ int64* current,
+ int64* peak) const {
+}
+
+void TestTaskManager::GetUSERHandles(TaskId task_id,
+ int64* current,
+ int64* peak) const {
+}
+
+bool TestTaskManager::IsTaskOnBackgroundedProcess(TaskId task_id) const {
+ return false;
+}
+
+const base::string16& TestTaskManager::GetTitle(TaskId task_id) const {
+ return title_;
+}
+
+const std::string& TestTaskManager::GetRapporSampleName(TaskId task_id) const {
+ return rappor_sample_;
+}
+
+base::string16 TestTaskManager::GetProfileName(TaskId task_id) const {
+ return base::string16();
+}
+
+const gfx::ImageSkia& TestTaskManager::GetIcon(TaskId task_id) const {
+ return icon_;
+}
+
+const base::ProcessHandle& TestTaskManager::GetProcessHandle(
+ TaskId task_id) const {
+ return handle_;
+}
+
+const base::ProcessId& TestTaskManager::GetProcessId(TaskId task_id) const {
+ return pid_;
+}
+
+Task::Type TestTaskManager::GetType(TaskId task_id) const {
+ return Task::UNKNOWN;
+}
+
+int64 TestTaskManager::GetNetworkUsage(TaskId task_id) const {
+ return -1;
+}
+
+int64 TestTaskManager::GetSqliteMemoryUsed(TaskId task_id) const {
+ return -1;
+}
+
+bool TestTaskManager::GetV8Memory(TaskId task_id,
+ int64* allocated,
+ int64* used) const {
+ return false;
+}
+
+bool TestTaskManager::GetWebCacheStats(
+ TaskId task_id,
+ blink::WebCache::ResourceTypeStats* stats) const {
+ return false;
+}
+
+const TaskIdList& TestTaskManager::GetTaskIdsList() const {
+ return ids_;
+}
+
+size_t TestTaskManager::GetNumberOfTasksOnSameProcess(TaskId task_id) const {
+ return 1;
+}
+
+base::TimeDelta TestTaskManager::GetRefreshTime() {
+ return GetCurrentRefreshTime();
+}
+
+int64 TestTaskManager::GetEnabledFlags() {
+ return enabled_resources_flags();
+}
+
+} // namespace task_management

Powered by Google App Engine
This is Rietveld 408576698