| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "chrome/browser/performance_monitor/database.h" | 13 #include "chrome/browser/performance_monitor/database.h" |
| 14 #include "chrome/browser/performance_monitor/key_builder.h" | 14 #include "chrome/browser/performance_monitor/key_builder.h" |
| 15 #include "chrome/browser/performance_monitor/metric.h" | 15 #include "chrome/browser/performance_monitor/metric.h" |
| 16 #include "chrome/browser/performance_monitor/performance_monitor_util.h" | 16 #include "chrome/browser/performance_monitor/performance_monitor_util.h" |
| 17 #include "chrome/common/extensions/extension.h" | 17 #include "extensions/common/extension.h" |
| 18 #include "extensions/common/manifest.h" | 18 #include "extensions/common/manifest.h" |
| 19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 20 #include "third_party/leveldatabase/src/include/leveldb/db.h" | 20 #include "third_party/leveldatabase/src/include/leveldb/db.h" |
| 21 #include "third_party/leveldatabase/src/include/leveldb/iterator.h" | 21 #include "third_party/leveldatabase/src/include/leveldb/iterator.h" |
| 22 | 22 |
| 23 using extensions::Extension; | 23 using extensions::Extension; |
| 24 using extensions::Manifest; | 24 using extensions::Manifest; |
| 25 | 25 |
| 26 namespace performance_monitor { | 26 namespace performance_monitor { |
| 27 | 27 |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 db_->AddMetric(kProcessChromeAggregate, | 525 db_->AddMetric(kProcessChromeAggregate, |
| 526 Metric(METRIC_CPU_USAGE, clock_->GetTime(), 21.0)); | 526 Metric(METRIC_CPU_USAGE, clock_->GetTime(), 21.0)); |
| 527 Database::MetricVector stats = | 527 Database::MetricVector stats = |
| 528 *db_->GetStatsForActivityAndMetric(METRIC_CPU_USAGE, start, end); | 528 *db_->GetStatsForActivityAndMetric(METRIC_CPU_USAGE, start, end); |
| 529 ASSERT_EQ(2u, stats.size()); | 529 ASSERT_EQ(2u, stats.size()); |
| 530 ASSERT_EQ(3, stats[0].value); | 530 ASSERT_EQ(3, stats[0].value); |
| 531 ASSERT_EQ(9, stats[1].value); | 531 ASSERT_EQ(9, stats[1].value); |
| 532 } | 532 } |
| 533 | 533 |
| 534 } // namespace performance_monitor | 534 } // namespace performance_monitor |
| OLD | NEW |