OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/task_management/test_task_manager.h" |
| 6 |
| 7 namespace task_management { |
| 8 |
| 9 TestTaskManager::TestTaskManager() |
| 10 : handle_(base::kNullProcessHandle), |
| 11 pid_(base::kNullProcessId) { |
| 12 set_timer_for_testing(scoped_ptr<base::Timer>(new base::MockTimer(true, |
| 13 true))); |
| 14 } |
| 15 |
| 16 TestTaskManager::~TestTaskManager() { |
| 17 } |
| 18 |
| 19 // task_management::TaskManagerInterface: |
| 20 void TestTaskManager::ActivateTask(TaskId task_id) { |
| 21 } |
| 22 |
| 23 double TestTaskManager::GetCpuUsage(TaskId task_id) const { |
| 24 return 0.0; |
| 25 } |
| 26 |
| 27 int64 TestTaskManager::GetPhysicalMemoryUsage(TaskId task_id) const { |
| 28 return -1; |
| 29 } |
| 30 |
| 31 int64 TestTaskManager::GetPrivateMemoryUsage(TaskId task_id) const { |
| 32 return -1; |
| 33 } |
| 34 |
| 35 int64 TestTaskManager::GetSharedMemoryUsage(TaskId task_id) const { |
| 36 return -1; |
| 37 } |
| 38 |
| 39 int64 TestTaskManager::GetGpuMemoryUsage(TaskId task_id, |
| 40 bool* has_duplicates) const { |
| 41 return -1; |
| 42 } |
| 43 |
| 44 int TestTaskManager::GetIdleWakeupsPerSecond(TaskId task_id) const { |
| 45 return -1; |
| 46 } |
| 47 |
| 48 int TestTaskManager::GetNaClDebugStubPort(TaskId task_id) const { |
| 49 return -1; |
| 50 } |
| 51 |
| 52 void TestTaskManager::GetGDIHandles(TaskId task_id, |
| 53 int64* current, |
| 54 int64* peak) const { |
| 55 } |
| 56 |
| 57 void TestTaskManager::GetUSERHandles(TaskId task_id, |
| 58 int64* current, |
| 59 int64* peak) const { |
| 60 } |
| 61 |
| 62 bool TestTaskManager::IsTaskOnBackgroundedProcess(TaskId task_id) const { |
| 63 return false; |
| 64 } |
| 65 |
| 66 const base::string16& TestTaskManager::GetTitle(TaskId task_id) const { |
| 67 return title_; |
| 68 } |
| 69 |
| 70 const std::string& TestTaskManager::GetTaskNameForRappor(TaskId task_id) const { |
| 71 return rappor_sample_; |
| 72 } |
| 73 |
| 74 base::string16 TestTaskManager::GetProfileName(TaskId task_id) const { |
| 75 return base::string16(); |
| 76 } |
| 77 |
| 78 const gfx::ImageSkia& TestTaskManager::GetIcon(TaskId task_id) const { |
| 79 return icon_; |
| 80 } |
| 81 |
| 82 const base::ProcessHandle& TestTaskManager::GetProcessHandle( |
| 83 TaskId task_id) const { |
| 84 return handle_; |
| 85 } |
| 86 |
| 87 const base::ProcessId& TestTaskManager::GetProcessId(TaskId task_id) const { |
| 88 return pid_; |
| 89 } |
| 90 |
| 91 Task::Type TestTaskManager::GetType(TaskId task_id) const { |
| 92 return Task::UNKNOWN; |
| 93 } |
| 94 |
| 95 int64 TestTaskManager::GetNetworkUsage(TaskId task_id) const { |
| 96 return -1; |
| 97 } |
| 98 |
| 99 int64 TestTaskManager::GetProcessTotalNetworkUsage(TaskId task_id) const { |
| 100 return -1; |
| 101 } |
| 102 |
| 103 int64 TestTaskManager::GetSqliteMemoryUsed(TaskId task_id) const { |
| 104 return -1; |
| 105 } |
| 106 |
| 107 bool TestTaskManager::GetV8Memory(TaskId task_id, |
| 108 int64* allocated, |
| 109 int64* used) const { |
| 110 return false; |
| 111 } |
| 112 |
| 113 bool TestTaskManager::GetWebCacheStats( |
| 114 TaskId task_id, |
| 115 blink::WebCache::ResourceTypeStats* stats) const { |
| 116 return false; |
| 117 } |
| 118 |
| 119 const TaskIdList& TestTaskManager::GetTaskIdsList() const { |
| 120 return ids_; |
| 121 } |
| 122 |
| 123 size_t TestTaskManager::GetNumberOfTasksOnSameProcess(TaskId task_id) const { |
| 124 return 1; |
| 125 } |
| 126 |
| 127 base::TimeDelta TestTaskManager::GetRefreshTime() { |
| 128 return GetCurrentRefreshTime(); |
| 129 } |
| 130 |
| 131 int64 TestTaskManager::GetEnabledFlags() { |
| 132 return enabled_resources_flags(); |
| 133 } |
| 134 |
| 135 } // namespace task_management |
OLD | NEW |