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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
141 } | 141 } |
142 if (should_skip) | 142 if (should_skip) |
143 continue; | 143 continue; |
144 | 144 |
145 // Read the file fully to get it into the cache. | 145 // Read the file fully to get it into the cache. |
146 // We don't care what the contents are. | 146 // We don't care what the contents are. |
147 if (file_util::ReadFileToString(path, NULL)) | 147 if (file_util::ReadFileToString(path, NULL)) |
148 ++loaded; | 148 ++loaded; |
149 } | 149 } |
150 } | 150 } |
151 VLOG(1) << "Buffer cache should be primed with " << loaded << " files."; | 151 VLOG(1) << "Buffer cache should be primed with " << loaded << " files."; |
erikwright (departed)
2010/10/22 13:50:23
Unrelated change in Trunk.
| |
152 } | 152 } |
153 | 153 |
154 class PageCyclerTest : public UIPerfTest { | 154 class PageCyclerTest : public UIPerfTest { |
155 protected: | 155 protected: |
156 bool print_times_only_; | 156 bool print_times_only_; |
157 int num_test_iterations_; | 157 int num_test_iterations_; |
158 #if defined(OS_MACOSX) | 158 #if defined(OS_MACOSX) |
159 rlim_t fd_limit_; | 159 rlim_t fd_limit_; |
160 #endif | 160 #endif |
161 public: | 161 public: |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
359 | 359 |
360 static bool HasDatabaseErrors(const std::string timings) { | 360 static bool HasDatabaseErrors(const std::string timings) { |
361 size_t pos = 0; | 361 size_t pos = 0; |
362 size_t new_pos = 0; | 362 size_t new_pos = 0; |
363 std::string time_str; | 363 std::string time_str; |
364 int time = 0; | 364 int time = 0; |
365 do { | 365 do { |
366 new_pos = timings.find(',', pos); | 366 new_pos = timings.find(',', pos); |
367 if (new_pos == std::string::npos) | 367 if (new_pos == std::string::npos) |
368 new_pos = timings.length(); | 368 new_pos = timings.length(); |
369 time_str = timings.substr(pos, new_pos - pos); | 369 if (!base::StringToInt(timings.begin() + pos, |
370 if (!base::StringToInt(time_str, &time)) { | 370 timings.begin() + new_pos, |
371 &time)) { | |
371 LOG(ERROR) << "Invalid time reported: " << time_str; | 372 LOG(ERROR) << "Invalid time reported: " << time_str; |
372 return true; | 373 return true; |
373 } | 374 } |
374 if (time < 0) { | 375 if (time < 0) { |
375 switch (time) { | 376 switch (time) { |
376 case -1: | 377 case -1: |
377 LOG(ERROR) << "Error while opening the database."; | 378 LOG(ERROR) << "Error while opening the database."; |
378 break; | 379 break; |
379 case -2: | 380 case -2: |
380 LOG(ERROR) << "Error while setting up the database."; | 381 LOG(ERROR) << "Error while setting up the database."; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
503 InsertTransactions); | 504 InsertTransactions); |
504 PAGE_CYCLER_DATABASE_TESTS("update-transactions", | 505 PAGE_CYCLER_DATABASE_TESTS("update-transactions", |
505 UpdateTransactions); | 506 UpdateTransactions); |
506 PAGE_CYCLER_DATABASE_TESTS("delete-transactions", | 507 PAGE_CYCLER_DATABASE_TESTS("delete-transactions", |
507 DeleteTransactions); | 508 DeleteTransactions); |
508 PAGE_CYCLER_DATABASE_TESTS("pseudo-random-transactions", | 509 PAGE_CYCLER_DATABASE_TESTS("pseudo-random-transactions", |
509 PseudoRandomTransactions); | 510 PseudoRandomTransactions); |
510 #endif | 511 #endif |
511 | 512 |
512 } // namespace | 513 } // namespace |
OLD | NEW |