| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_BROWSER_TASK_MANAGER_TEST_TASK_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_TASK_MANAGER_TEST_TASK_MANAGER_H_ |
| 6 #define CHROME_BROWSER_TASK_MANAGER_TEST_TASK_MANAGER_H_ | 6 #define CHROME_BROWSER_TASK_MANAGER_TEST_TASK_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/time/time.h" |
| 12 #include "base/timer/mock_timer.h" | 13 #include "base/timer/mock_timer.h" |
| 13 #include "chrome/browser/task_manager/task_manager_interface.h" | 14 #include "chrome/browser/task_manager/task_manager_interface.h" |
| 14 | 15 |
| 15 namespace task_manager { | 16 namespace task_manager { |
| 16 | 17 |
| 17 // This is a partial stub implementation that can be used as a base class for | 18 // This is a partial stub implementation that can be used as a base class for |
| 18 // implementations of the task manager used in unit tests. | 19 // implementations of the task manager used in unit tests. |
| 19 class TestTaskManager : public TaskManagerInterface { | 20 class TestTaskManager : public TaskManagerInterface { |
| 20 public: | 21 public: |
| 21 TestTaskManager(); | 22 TestTaskManager(); |
| 22 ~TestTaskManager() override; | 23 ~TestTaskManager() override; |
| 23 | 24 |
| 24 // task_manager::TaskManagerInterface: | 25 // task_manager::TaskManagerInterface: |
| 25 void ActivateTask(TaskId task_id) override; | 26 void ActivateTask(TaskId task_id) override; |
| 26 bool IsTaskKillable(TaskId task_id) override; | 27 bool IsTaskKillable(TaskId task_id) override; |
| 27 void KillTask(TaskId task_id) override; | 28 void KillTask(TaskId task_id) override; |
| 28 double GetCpuUsage(TaskId task_id) const override; | 29 double GetCpuUsage(TaskId task_id) const override; |
| 30 base::Time GetStartTime(TaskId task_id) const override; |
| 31 base::TimeDelta GetCpuTime(TaskId task_id) const override; |
| 29 int64_t GetPhysicalMemoryUsage(TaskId task_id) const override; | 32 int64_t GetPhysicalMemoryUsage(TaskId task_id) const override; |
| 30 int64_t GetPrivateMemoryUsage(TaskId task_id) const override; | 33 int64_t GetPrivateMemoryUsage(TaskId task_id) const override; |
| 31 int64_t GetSharedMemoryUsage(TaskId task_id) const override; | 34 int64_t GetSharedMemoryUsage(TaskId task_id) const override; |
| 32 int64_t GetSwappedMemoryUsage(TaskId task_id) const override; | 35 int64_t GetSwappedMemoryUsage(TaskId task_id) const override; |
| 33 int64_t GetGpuMemoryUsage(TaskId task_id, | 36 int64_t GetGpuMemoryUsage(TaskId task_id, |
| 34 bool* has_duplicates) const override; | 37 bool* has_duplicates) const override; |
| 35 base::MemoryState GetMemoryState(TaskId task_id) const override; | 38 base::MemoryState GetMemoryState(TaskId task_id) const override; |
| 36 int GetIdleWakeupsPerSecond(TaskId task_id) const override; | 39 int GetIdleWakeupsPerSecond(TaskId task_id) const override; |
| 37 int GetNaClDebugStubPort(TaskId task_id) const override; | 40 int GetNaClDebugStubPort(TaskId task_id) const override; |
| 38 void GetGDIHandles(TaskId task_id, | 41 void GetGDIHandles(TaskId task_id, |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 gfx::ImageSkia icon_; | 89 gfx::ImageSkia icon_; |
| 87 TaskIdList ids_; | 90 TaskIdList ids_; |
| 88 | 91 |
| 89 private: | 92 private: |
| 90 DISALLOW_COPY_AND_ASSIGN(TestTaskManager); | 93 DISALLOW_COPY_AND_ASSIGN(TestTaskManager); |
| 91 }; | 94 }; |
| 92 | 95 |
| 93 } // namespace task_manager | 96 } // namespace task_manager |
| 94 | 97 |
| 95 #endif // CHROME_BROWSER_TASK_MANAGER_TEST_TASK_MANAGER_H_ | 98 #endif // CHROME_BROWSER_TASK_MANAGER_TEST_TASK_MANAGER_H_ |
| OLD | NEW |