| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 void FillTable(VisitedLinkMaster& master, const char* prefix, | 58 void FillTable(VisitedLinkMaster& master, const char* prefix, |
| 59 int begin, int end) { | 59 int begin, int end) { |
| 60 for (int i = begin; i < end; i++) | 60 for (int i = begin; i < end; i++) |
| 61 master.AddURL(TestURL(prefix, i)); | 61 master.AddURL(TestURL(prefix, i)); |
| 62 } | 62 } |
| 63 | 63 |
| 64 class VisitedLink : public testing::Test { | 64 class VisitedLink : public testing::Test { |
| 65 protected: | 65 protected: |
| 66 base::FilePath db_path_; | 66 base::FilePath db_path_; |
| 67 virtual void SetUp() { | 67 virtual void SetUp() { |
| 68 ASSERT_TRUE(file_util::CreateTemporaryFile(&db_path_)); | 68 ASSERT_TRUE(base::CreateTemporaryFile(&db_path_)); |
| 69 } | 69 } |
| 70 virtual void TearDown() { | 70 virtual void TearDown() { |
| 71 base::DeleteFile(db_path_, false); | 71 base::DeleteFile(db_path_, false); |
| 72 } | 72 } |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 } // namespace | 75 } // namespace |
| 76 | 76 |
| 77 // This test tests adding many things to a database, and how long it takes | 77 // This test tests adding many things to a database, and how long it takes |
| 78 // to query the database with different numbers of things in it. The time | 78 // to query the database with different numbers of things in it. The time |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 cold_sum += cold_load_times[i]; | 192 cold_sum += cold_load_times[i]; |
| 193 hot_sum += hot_load_times[i]; | 193 hot_sum += hot_load_times[i]; |
| 194 } | 194 } |
| 195 base::LogPerfResult( | 195 base::LogPerfResult( |
| 196 "Visited_link_cold_load_time", cold_sum / cold_load_times.size(), "ms"); | 196 "Visited_link_cold_load_time", cold_sum / cold_load_times.size(), "ms"); |
| 197 base::LogPerfResult( | 197 base::LogPerfResult( |
| 198 "Visited_link_hot_load_time", hot_sum / hot_load_times.size(), "ms"); | 198 "Visited_link_hot_load_time", hot_sum / hot_load_times.size(), "ms"); |
| 199 } | 199 } |
| 200 | 200 |
| 201 } // namespace visitedlink | 201 } // namespace visitedlink |
| OLD | NEW |