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 #include <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <limits> | 8 #include <limits> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 | 275 |
276 // Make sure that the ResourceReporter is no longer listening to the task | 276 // Make sure that the ResourceReporter is no longer listening to the task |
277 // manager right after the refresh. | 277 // manager right after the refresh. |
278 EXPECT_FALSE(resource_reporter()->observed_task_manager()); | 278 EXPECT_FALSE(resource_reporter()->observed_task_manager()); |
279 | 279 |
280 // Make sure the ResourceReporter is not tracking any but the tasks exceeding | 280 // Make sure the ResourceReporter is not tracking any but the tasks exceeding |
281 // the defined resource use thresholds. | 281 // the defined resource use thresholds. |
282 ASSERT_FALSE(resource_reporter()->task_records_.empty()); | 282 ASSERT_FALSE(resource_reporter()->task_records_.empty()); |
283 for (const auto& task_record : resource_reporter()->task_records_) { | 283 for (const auto& task_record : resource_reporter()->task_records_) { |
284 EXPECT_TRUE(task_record.cpu_percent >= | 284 EXPECT_TRUE(task_record.cpu_percent >= |
285 ResourceReporter::kTaskCpuThresholdForReporting || | 285 ResourceReporter::GetTaskCpuThresholdForReporting() || |
286 task_record.memory_bytes >= | 286 task_record.memory_bytes >= |
287 ResourceReporter::kTaskMemoryThresholdForReporting); | 287 ResourceReporter::GetTaskMemoryThresholdForReporting()); |
288 } | 288 } |
289 | 289 |
290 // Make sure you have the right info about the Browser and GPU process. | 290 // Make sure you have the right info about the Browser and GPU process. |
291 EXPECT_EQ(resource_reporter()->last_browser_process_cpu_, kBrowserProcessCpu); | 291 EXPECT_EQ(resource_reporter()->last_browser_process_cpu_, kBrowserProcessCpu); |
292 EXPECT_EQ(resource_reporter()->last_browser_process_memory_, | 292 EXPECT_EQ(resource_reporter()->last_browser_process_memory_, |
293 kBrowserProcessMemory); | 293 kBrowserProcessMemory); |
294 EXPECT_EQ(resource_reporter()->last_gpu_process_cpu_, kGpuProcessCpu); | 294 EXPECT_EQ(resource_reporter()->last_gpu_process_cpu_, kGpuProcessCpu); |
295 EXPECT_EQ(resource_reporter()->last_gpu_process_memory_, kGpuProcessMemory); | 295 EXPECT_EQ(resource_reporter()->last_gpu_process_memory_, kGpuProcessMemory); |
296 } | 296 } |
297 | 297 |
298 } // namespace chromeos | 298 } // namespace chromeos |
OLD | NEW |