OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/perftimer.h" | 10 #include "base/perftimer.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 const char added_prefix[] = "http://www.google.com/stuff/something/foo?session=8
5025602345625&id=1345142319023&seq="; | 24 const char added_prefix[] = "http://www.google.com/stuff/something/foo?session=8
5025602345625&id=1345142319023&seq="; |
25 const char unadded_prefix[] = "http://www.google.org/stuff/something/foo?session
=39586739476365&id=2347624314402&seq="; | 25 const char unadded_prefix[] = "http://www.google.org/stuff/something/foo?session
=39586739476365&id=2347624314402&seq="; |
26 | 26 |
27 // Returns a URL with the given prefix and index | 27 // Returns a URL with the given prefix and index |
28 GURL TestURL(const char* prefix, int i) { | 28 GURL TestURL(const char* prefix, int i) { |
29 return GURL(StringPrintf("%s%d", prefix, i)); | 29 return GURL(StringPrintf("%s%d", prefix, i)); |
30 } | 30 } |
31 | 31 |
32 // we have no slaves, so this broadcase is a NOP | 32 // we have no slaves, so this broadcase is a NOP |
33 VisitedLinkMaster::PostNewTableEvent DummyBroadcastNewTableEvent; | 33 VisitedLinkMaster::PostNewTableEvent DummyBroadcastNewTableEvent; |
34 void DummyBroadcastNewTableEvent(SharedMemory *table) { | 34 void DummyBroadcastNewTableEvent(base::SharedMemory *table) { |
35 } | 35 } |
36 | 36 |
37 // Call at the beginning of the test to retrieve the database name and to | 37 // Call at the beginning of the test to retrieve the database name and to |
38 // delete any old databases left by previous unit tests. The input buffer | 38 // delete any old databases left by previous unit tests. The input buffer |
39 // should be MAX_PATH long. | 39 // should be MAX_PATH long. |
40 void InitDBName(wchar_t* db_name) { | 40 void InitDBName(wchar_t* db_name) { |
41 ASSERT_TRUE(GetCurrentDirectory(MAX_PATH, db_name)); | 41 ASSERT_TRUE(GetCurrentDirectory(MAX_PATH, db_name)); |
42 if (db_name[wcslen(db_name) - 1] != file_util::kPathSeparator) | 42 if (db_name[wcslen(db_name) - 1] != file_util::kPathSeparator) |
43 wcsncat_s(db_name, MAX_PATH, &file_util::kPathSeparator, 1); | 43 wcsncat_s(db_name, MAX_PATH, &file_util::kPathSeparator, 1); |
44 wcscat_s(db_name, MAX_PATH, L"TempVisitedLinks"); | 44 wcscat_s(db_name, MAX_PATH, L"TempVisitedLinks"); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 for (int i = 0; i < static_cast<int>(cold_load_times.size()); i++) { | 184 for (int i = 0; i < static_cast<int>(cold_load_times.size()); i++) { |
185 cold_sum += cold_load_times[i]; | 185 cold_sum += cold_load_times[i]; |
186 hot_sum += hot_load_times[i]; | 186 hot_sum += hot_load_times[i]; |
187 } | 187 } |
188 LogPerfResult("Visited_link_cold_load_time", | 188 LogPerfResult("Visited_link_cold_load_time", |
189 cold_sum / cold_load_times.size(), "ms"); | 189 cold_sum / cold_load_times.size(), "ms"); |
190 LogPerfResult("Visited_link_hot_load_time", | 190 LogPerfResult("Visited_link_hot_load_time", |
191 hot_sum / hot_load_times.size(), "ms"); | 191 hot_sum / hot_load_times.size(), "ms"); |
192 } | 192 } |
193 | 193 |
OLD | NEW |