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

Unified Diff: chrome/browser/task_management/test_task_manager.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: Turn off ResourceReporter on task_management CrOs browser_tests. 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
« no previous file with comments | « chrome/browser/task_management/test_task_manager.h ('k') | chrome/chrome_browser_chromeos.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/task_management/test_task_manager.cc
diff --git a/chrome/browser/task_management/test_task_manager.cc b/chrome/browser/task_management/test_task_manager.cc
new file mode 100644
index 0000000000000000000000000000000000000000..caab35fd79c1e09726d6a790f42751968097443d
--- /dev/null
+++ b/chrome/browser/task_management/test_task_manager.cc
@@ -0,0 +1,135 @@
+// 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/test_task_manager.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::GetTaskNameForRappor(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::GetProcessTotalNetworkUsage(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
« no previous file with comments | « chrome/browser/task_management/test_task_manager.h ('k') | chrome/chrome_browser_chromeos.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698