OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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" |
11 #include "base/string_number_conversions.h" | 11 #include "base/string_number_conversions.h" |
| 12 #include "base/string_piece.h" |
12 #include "base/sys_string_conversions.h" | 13 #include "base/sys_string_conversions.h" |
13 #include "base/test/test_timeouts.h" | 14 #include "base/test/test_timeouts.h" |
14 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
15 #include "chrome/browser/net/url_fixer_upper.h" | 16 #include "chrome/browser/net/url_fixer_upper.h" |
16 #include "chrome/common/chrome_constants.h" | 17 #include "chrome/common/chrome_constants.h" |
17 #include "chrome/common/chrome_paths.h" | 18 #include "chrome/common/chrome_paths.h" |
18 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
19 #include "chrome/test/automation/tab_proxy.h" | 20 #include "chrome/test/automation/tab_proxy.h" |
20 #include "chrome/test/automation/window_proxy.h" | 21 #include "chrome/test/automation/window_proxy.h" |
21 #include "chrome/test/base/chrome_process_util.h" | 22 #include "chrome/test/base/chrome_process_util.h" |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 | 325 |
325 static bool HasDatabaseErrors(const std::string timings) { | 326 static bool HasDatabaseErrors(const std::string timings) { |
326 size_t pos = 0; | 327 size_t pos = 0; |
327 size_t new_pos = 0; | 328 size_t new_pos = 0; |
328 std::string time_str; | 329 std::string time_str; |
329 int time = 0; | 330 int time = 0; |
330 do { | 331 do { |
331 new_pos = timings.find(',', pos); | 332 new_pos = timings.find(',', pos); |
332 if (new_pos == std::string::npos) | 333 if (new_pos == std::string::npos) |
333 new_pos = timings.length(); | 334 new_pos = timings.length(); |
334 if (!base::StringToInt(timings.begin() + pos, | 335 if (!base::StringToInt(base::StringPiece(timings.begin() + pos, |
335 timings.begin() + new_pos, | 336 timings.begin() + new_pos), |
336 &time)) { | 337 &time)) { |
337 LOG(ERROR) << "Invalid time reported: " << time_str; | 338 LOG(ERROR) << "Invalid time reported: " << time_str; |
338 return true; | 339 return true; |
339 } | 340 } |
340 if (time < 0) { | 341 if (time < 0) { |
341 switch (time) { | 342 switch (time) { |
342 case -1: | 343 case -1: |
343 LOG(ERROR) << "Error while opening the database."; | 344 LOG(ERROR) << "Error while opening the database."; |
344 break; | 345 break; |
345 case -2: | 346 case -2: |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 PAGE_CYCLER_DATABASE_TESTS("delete-transactions", | 531 PAGE_CYCLER_DATABASE_TESTS("delete-transactions", |
531 DeleteTransactions); | 532 DeleteTransactions); |
532 PAGE_CYCLER_DATABASE_TESTS("pseudo-random-transactions", | 533 PAGE_CYCLER_DATABASE_TESTS("pseudo-random-transactions", |
533 PseudoRandomTransactions); | 534 PseudoRandomTransactions); |
534 #endif | 535 #endif |
535 | 536 |
536 // Indexed DB tests. | 537 // Indexed DB tests. |
537 PAGE_CYCLER_IDB_TESTS("basic_insert", BasicInsert); | 538 PAGE_CYCLER_IDB_TESTS("basic_insert", BasicInsert); |
538 | 539 |
539 } // namespace | 540 } // namespace |
OLD | NEW |