| 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 "base/environment.h" | 5 #include "base/environment.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 set_template_user_data(base::FilePath()); | 288 set_template_user_data(base::FilePath()); |
| 289 } | 289 } |
| 290 } | 290 } |
| 291 | 291 |
| 292 std::string times; | 292 std::string times; |
| 293 for (int i = 0; i < numCycles; ++i) { | 293 for (int i = 0; i < numCycles; ++i) { |
| 294 base::StringAppendF(×, | 294 base::StringAppendF(×, |
| 295 "%.2f,", | 295 "%.2f,", |
| 296 timings[i].end_to_end.InMillisecondsF()); | 296 timings[i].end_to_end.InMillisecondsF()); |
| 297 } | 297 } |
| 298 perf_test::PrintResultList(graph, "", trace, times, "ms", important); | 298 perf_test::PrintResultList( |
| 299 graph, std::string(), trace, times, "ms", important); |
| 299 | 300 |
| 300 if (num_tabs > 0) { | 301 if (num_tabs > 0) { |
| 301 std::string name_base = trace; | 302 std::string name_base = trace; |
| 302 std::string name; | 303 std::string name; |
| 303 | 304 |
| 304 times.clear(); | 305 times.clear(); |
| 305 name = name_base + "-start"; | 306 name = name_base + "-start"; |
| 306 for (int i = 0; i < numCycles; ++i) | 307 for (int i = 0; i < numCycles; ++i) |
| 307 base::StringAppendF(×, "%.2f,", timings[i].first_start_ms); | 308 base::StringAppendF(×, "%.2f,", timings[i].first_start_ms); |
| 308 perf_test::PrintResultList(graph, "", name.c_str(), times, "ms", | 309 perf_test::PrintResultList( |
| 309 important); | 310 graph, std::string(), name.c_str(), times, "ms", important); |
| 310 | 311 |
| 311 times.clear(); | 312 times.clear(); |
| 312 name = name_base + "-first"; | 313 name = name_base + "-first"; |
| 313 for (int i = 0; i < numCycles; ++i) | 314 for (int i = 0; i < numCycles; ++i) |
| 314 base::StringAppendF(×, "%.2f,", timings[i].first_stop_ms); | 315 base::StringAppendF(×, "%.2f,", timings[i].first_stop_ms); |
| 315 perf_test::PrintResultList(graph, "", name.c_str(), times, "ms", | 316 perf_test::PrintResultList( |
| 316 important); | 317 graph, std::string(), name.c_str(), times, "ms", important); |
| 317 | 318 |
| 318 if (nth_timed_tab > 0) { | 319 if (nth_timed_tab > 0) { |
| 319 // Display only the time necessary to load the first n tabs. | 320 // Display only the time necessary to load the first n tabs. |
| 320 times.clear(); | 321 times.clear(); |
| 321 name = name_base + "-" + base::IntToString(nth_timed_tab); | 322 name = name_base + "-" + base::IntToString(nth_timed_tab); |
| 322 for (int i = 0; i < numCycles; ++i) | 323 for (int i = 0; i < numCycles; ++i) |
| 323 base::StringAppendF(×, "%.2f,", timings[i].nth_tab_stop_ms); | 324 base::StringAppendF(×, "%.2f,", timings[i].nth_tab_stop_ms); |
| 324 perf_test::PrintResultList(graph, "", name.c_str(), times, "ms", | 325 perf_test::PrintResultList( |
| 325 important); | 326 graph, std::string(), name.c_str(), times, "ms", important); |
| 326 } | 327 } |
| 327 | 328 |
| 328 if (num_tabs > 1) { | 329 if (num_tabs > 1) { |
| 329 // Display the time necessary to load all of the tabs. | 330 // Display the time necessary to load all of the tabs. |
| 330 times.clear(); | 331 times.clear(); |
| 331 name = name_base + "-all"; | 332 name = name_base + "-all"; |
| 332 for (int i = 0; i < numCycles; ++i) | 333 for (int i = 0; i < numCycles; ++i) |
| 333 base::StringAppendF(×, "%.2f,", timings[i].last_stop_ms); | 334 base::StringAppendF(×, "%.2f,", timings[i].last_stop_ms); |
| 334 perf_test::PrintResultList(graph, "", name.c_str(), times, "ms", | 335 perf_test::PrintResultList( |
| 335 important); | 336 graph, std::string(), name.c_str(), times, "ms", important); |
| 336 } | 337 } |
| 337 } | 338 } |
| 338 } | 339 } |
| 339 | 340 |
| 340 base::FilePath profiling_file_; | 341 base::FilePath profiling_file_; |
| 341 bool collect_profiling_stats_; | 342 bool collect_profiling_stats_; |
| 342 bool tracing_enabled_; | 343 bool tracing_enabled_; |
| 343 std::string trace_file_prefix_; | 344 std::string trace_file_prefix_; |
| 344 }; | 345 }; |
| 345 | 346 |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 SetUpWithFileURL(); | 527 SetUpWithFileURL(); |
| 527 SetUpWithProfiling(); | 528 SetUpWithProfiling(); |
| 528 SetUpWithForceCompositingMode(); | 529 SetUpWithForceCompositingMode(); |
| 529 SetUpWithTracing("startup_trace_fcm_"); | 530 SetUpWithTracing("startup_trace_fcm_"); |
| 530 RunStartupTest("warm", "traced_profiling_scripts1_fcm", WARM, NOT_IMPORTANT, | 531 RunStartupTest("warm", "traced_profiling_scripts1_fcm", WARM, NOT_IMPORTANT, |
| 531 UITestBase::DEFAULT_THEME, 1, 0); | 532 UITestBase::DEFAULT_THEME, 1, 0); |
| 532 } | 533 } |
| 533 #endif | 534 #endif |
| 534 | 535 |
| 535 } // namespace | 536 } // namespace |
| OLD | NEW |