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 #include "chrome_frame/test/perf/chrome_frame_perftest.h" | 4 #include "chrome_frame/test/perf/chrome_frame_perftest.h" |
5 | 5 |
6 #include <atlwin.h> | 6 #include <atlwin.h> |
7 #include <atlhost.h> | 7 #include <atlhost.h> |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 #include <string> | 10 #include <string> |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 | 341 |
342 CoFreeUnusedLibraries(); | 342 CoFreeUnusedLibraries(); |
343 | 343 |
344 // TODO(beng): Can't shut down so quickly. Figure out why, and fix. If we | 344 // TODO(beng): Can't shut down so quickly. Figure out why, and fix. If we |
345 // do, we crash. | 345 // do, we crash. |
346 PlatformThread::Sleep(50); | 346 PlatformThread::Sleep(50); |
347 } | 347 } |
348 | 348 |
349 std::string times; | 349 std::string times; |
350 for (int i = 0; i < kNumCycles; ++i) | 350 for (int i = 0; i < kNumCycles; ++i) |
351 StringAppendF(×, "%.2f,", timings[i].InMillisecondsF()); | 351 base::StringAppendF(×, "%.2f,", timings[i].InMillisecondsF()); |
352 | 352 |
353 PrintResultList(graph, "", trace, times, "ms", important); | 353 PrintResultList(graph, "", trace, times, "ms", important); |
354 } | 354 } |
355 | 355 |
356 FilePath dir_app_; | 356 FilePath dir_app_; |
357 FilePath chrome_dll_; | 357 FilePath chrome_dll_; |
358 FilePath chrome_exe_; | 358 FilePath chrome_exe_; |
359 FilePath chrome_frame_dll_; | 359 FilePath chrome_frame_dll_; |
360 FilePath icu_dll_; | 360 FilePath icu_dll_; |
361 FilePath gears_dll_; | 361 FilePath gears_dll_; |
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1375 } | 1375 } |
1376 | 1376 |
1377 template <class Monitor> | 1377 template <class Monitor> |
1378 void PrintPerfTestResults(const Monitor* monitor, | 1378 void PrintPerfTestResults(const Monitor* monitor, |
1379 int num_cycles, | 1379 int num_cycles, |
1380 const char* result_name) { | 1380 const char* result_name) { |
1381 std::string times; | 1381 std::string times; |
1382 | 1382 |
1383 for (int i = 0; i < num_cycles; ++i) { | 1383 for (int i = 0; i < num_cycles; ++i) { |
1384 ASSERT_TRUE(monitor[i].is_valid()); | 1384 ASSERT_TRUE(monitor[i].is_valid()); |
1385 StringAppendF(×, "%.2f,", | 1385 base::StringAppendF(×, |
1386 monitor[i].duration().InMillisecondsF()); | 1386 "%.2f,", |
| 1387 monitor[i].duration().InMillisecondsF()); |
1387 } | 1388 } |
1388 | 1389 |
1389 PrintResultList(result_name, "", "t", times, "ms", false); | 1390 PrintResultList(result_name, "", "t", times, "ms", false); |
1390 } | 1391 } |
1391 | 1392 |
1392 TEST(TestAsPerfTest, MetaTag_createproxy) { | 1393 TEST(TestAsPerfTest, MetaTag_createproxy) { |
1393 const int kNumCycles = 10; | 1394 const int kNumCycles = 10; |
1394 | 1395 |
1395 MonitorTracePair create_proxy_monitor[kNumCycles]; | 1396 MonitorTracePair create_proxy_monitor[kNumCycles]; |
1396 MonitorTraceBetweenEventPair browser_main_start_monitor[kNumCycles]; | 1397 MonitorTraceBetweenEventPair browser_main_start_monitor[kNumCycles]; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1456 PrintPerfTestResults(automation_provider_connect_monitor, kNumCycles, | 1457 PrintPerfTestResults(automation_provider_connect_monitor, kNumCycles, |
1457 "automationproviderconnect"); | 1458 "automationproviderconnect"); |
1458 PrintPerfTestResults(external_tab_navigate_monitor, kNumCycles, | 1459 PrintPerfTestResults(external_tab_navigate_monitor, kNumCycles, |
1459 "externaltabnavigate"); | 1460 "externaltabnavigate"); |
1460 PrintPerfTestResults(renderer_main_monitor, kNumCycles, | 1461 PrintPerfTestResults(renderer_main_monitor, kNumCycles, |
1461 "beginrenderermain"); | 1462 "beginrenderermain"); |
1462 #ifdef NDEBUG | 1463 #ifdef NDEBUG |
1463 PrintPerfTestResults(pre_read_chrome_monitor, kNumCycles, "PreReadImage"); | 1464 PrintPerfTestResults(pre_read_chrome_monitor, kNumCycles, "PreReadImage"); |
1464 #endif // NDEBUG | 1465 #endif // NDEBUG |
1465 } | 1466 } |
OLD | NEW |