| 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 #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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 ChromeFrameStartupTest() {} | 288 ChromeFrameStartupTest() {} |
| 289 | 289 |
| 290 virtual void SetUp() { | 290 virtual void SetUp() { |
| 291 ASSERT_TRUE(PathService::Get(chrome::DIR_APP, &dir_app_)); | 291 ASSERT_TRUE(PathService::Get(chrome::DIR_APP, &dir_app_)); |
| 292 | 292 |
| 293 chrome_dll_ = dir_app_.Append(L"chrome.dll"); | 293 chrome_dll_ = dir_app_.Append(L"chrome.dll"); |
| 294 chrome_exe_ = dir_app_.Append(chrome::kBrowserProcessExecutableName); | 294 chrome_exe_ = dir_app_.Append(chrome::kBrowserProcessExecutableName); |
| 295 chrome_frame_dll_ = dir_app_.Append(L"servers"); | 295 chrome_frame_dll_ = dir_app_.Append(L"servers"); |
| 296 chrome_frame_dll_ = chrome_frame_dll_.Append(kChromeFrameDllName); | 296 chrome_frame_dll_ = chrome_frame_dll_.Append(kChromeFrameDllName); |
| 297 icu_dll_ = dir_app_.Append(L"icudt.dll"); | 297 icu_dll_ = dir_app_.Append(L"icudt.dll"); |
| 298 avcodec52_dll_ = dir_app_.Append(L"avcodec-52.dll"); | 298 avcodec_dll_ = dir_app_.Append(L"avcodec-53.dll"); |
| 299 avformat52_dll_ = dir_app_.Append(L"avformat-52.dll"); | 299 avformat_dll_ = dir_app_.Append(L"avformat-53.dll"); |
| 300 avutil50_dll_ = dir_app_.Append(L"avutil-50.dll"); | 300 avutil_dll_ = dir_app_.Append(L"avutil-51.dll"); |
| 301 } | 301 } |
| 302 | 302 |
| 303 // TODO(iyengar) | 303 // TODO(iyengar) |
| 304 // This function is similar to the RunStartupTest function used in chrome | 304 // This function is similar to the RunStartupTest function used in chrome |
| 305 // startup tests. Refactor into a common implementation. | 305 // startup tests. Refactor into a common implementation. |
| 306 void RunStartupTest(const char* graph, const char* trace, | 306 void RunStartupTest(const char* graph, const char* trace, |
| 307 const char* startup_url, bool test_cold, | 307 const char* startup_url, bool test_cold, |
| 308 int total_binaries, const FilePath binaries_to_evict[], | 308 int total_binaries, const FilePath binaries_to_evict[], |
| 309 bool important, bool ignore_cache_error) { | 309 bool important, bool ignore_cache_error) { |
| 310 const int kNumCycles = 20; | 310 const int kNumCycles = 20; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 base::StringAppendF(×, "%.2f,", timings[i].InMillisecondsF()); | 348 base::StringAppendF(×, "%.2f,", timings[i].InMillisecondsF()); |
| 349 | 349 |
| 350 PrintResultList(graph, "", trace, times, "ms", important); | 350 PrintResultList(graph, "", trace, times, "ms", important); |
| 351 } | 351 } |
| 352 | 352 |
| 353 FilePath dir_app_; | 353 FilePath dir_app_; |
| 354 FilePath chrome_dll_; | 354 FilePath chrome_dll_; |
| 355 FilePath chrome_exe_; | 355 FilePath chrome_exe_; |
| 356 FilePath chrome_frame_dll_; | 356 FilePath chrome_frame_dll_; |
| 357 FilePath icu_dll_; | 357 FilePath icu_dll_; |
| 358 FilePath avcodec52_dll_; | 358 FilePath avcodec_dll_; |
| 359 FilePath avformat52_dll_; | 359 FilePath avformat_dll_; |
| 360 FilePath avutil50_dll_; | 360 FilePath avutil_dll_; |
| 361 | 361 |
| 362 protected: | 362 protected: |
| 363 // Individual startup tests should implement this function. | 363 // Individual startup tests should implement this function. |
| 364 virtual void RunStartupTestImpl(TimeTicks* start_time, | 364 virtual void RunStartupTestImpl(TimeTicks* start_time, |
| 365 TimeTicks* end_time) {} | 365 TimeTicks* end_time) {} |
| 366 | 366 |
| 367 // The host is torn down by this function. It should not be used after | 367 // The host is torn down by this function. It should not be used after |
| 368 // this function returns. | 368 // this function returns. |
| 369 static void ReleaseHostComReferences(CAxWindow& host) { | 369 static void ReleaseHostComReferences(CAxWindow& host) { |
| 370 CComPtr<IAxWinHostWindow> spWinHost; | 370 CComPtr<IAxWinHostWindow> spWinHost; |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 957 } | 957 } |
| 958 | 958 |
| 959 TEST_F(ChromeFrameBinariesLoadTest, PerfWarm) { | 959 TEST_F(ChromeFrameBinariesLoadTest, PerfWarm) { |
| 960 RunStartupTest("binary_load_warm", "t", "", false /* cold */, 0, NULL, | 960 RunStartupTest("binary_load_warm", "t", "", false /* cold */, 0, NULL, |
| 961 true /* important */, false); | 961 true /* important */, false); |
| 962 } | 962 } |
| 963 | 963 |
| 964 TEST_F(ChromeFrameStartupTestActiveX, PerfCold) { | 964 TEST_F(ChromeFrameStartupTestActiveX, PerfCold) { |
| 965 SetConfigInt(L"PreRead", 0); | 965 SetConfigInt(L"PreRead", 0); |
| 966 FilePath binaries_to_evict[] = { | 966 FilePath binaries_to_evict[] = { |
| 967 avcodec52_dll_, avformat52_dll_, avutil50_dll_, chrome_exe_, chrome_dll_, | 967 avcodec_dll_, avformat_dll_, avutil_dll_, chrome_exe_, chrome_dll_, |
| 968 chrome_frame_dll_ | 968 chrome_frame_dll_ |
| 969 }; | 969 }; |
| 970 RunStartupTest("cold", "t", "about:blank", true /* cold */, | 970 RunStartupTest("cold", "t", "about:blank", true /* cold */, |
| 971 arraysize(binaries_to_evict), binaries_to_evict, | 971 arraysize(binaries_to_evict), binaries_to_evict, |
| 972 false /* not important */, false); | 972 false /* not important */, false); |
| 973 DeleteConfigValue(L"PreRead"); | 973 DeleteConfigValue(L"PreRead"); |
| 974 } | 974 } |
| 975 | 975 |
| 976 TEST_F(ChromeFrameStartupTestActiveX, PerfColdPreRead) { | 976 TEST_F(ChromeFrameStartupTestActiveX, PerfColdPreRead) { |
| 977 SetConfigInt(L"PreRead", 1); | 977 SetConfigInt(L"PreRead", 1); |
| 978 FilePath binaries_to_evict[] = { | 978 FilePath binaries_to_evict[] = { |
| 979 avcodec52_dll_, avformat52_dll_, avutil50_dll_, chrome_exe_, chrome_dll_, | 979 avcodec_dll_, avformat_dll_, avutil_dll_, chrome_exe_, chrome_dll_, |
| 980 chrome_frame_dll_ | 980 chrome_frame_dll_ |
| 981 }; | 981 }; |
| 982 RunStartupTest("cold_preread", "t", "about:blank", true /* cold */, | 982 RunStartupTest("cold_preread", "t", "about:blank", true /* cold */, |
| 983 arraysize(binaries_to_evict), binaries_to_evict, | 983 arraysize(binaries_to_evict), binaries_to_evict, |
| 984 false /* not important */, false); | 984 false /* not important */, false); |
| 985 DeleteConfigValue(L"PreRead"); | 985 DeleteConfigValue(L"PreRead"); |
| 986 } | 986 } |
| 987 | 987 |
| 988 TEST_F(ChromeFrameBinariesLoadTest, PerfCold) { | 988 TEST_F(ChromeFrameBinariesLoadTest, PerfCold) { |
| 989 FilePath binaries_to_evict[] = {chrome_exe_, chrome_dll_}; | 989 FilePath binaries_to_evict[] = {chrome_exe_, chrome_dll_}; |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1473 PrintPerfTestResults(automation_provider_connect_monitor, kNumCycles, | 1473 PrintPerfTestResults(automation_provider_connect_monitor, kNumCycles, |
| 1474 "automationproviderconnect"); | 1474 "automationproviderconnect"); |
| 1475 PrintPerfTestResults(external_tab_navigate_monitor, kNumCycles, | 1475 PrintPerfTestResults(external_tab_navigate_monitor, kNumCycles, |
| 1476 "externaltabnavigate"); | 1476 "externaltabnavigate"); |
| 1477 PrintPerfTestResults(renderer_main_monitor, kNumCycles, | 1477 PrintPerfTestResults(renderer_main_monitor, kNumCycles, |
| 1478 "beginrenderermain"); | 1478 "beginrenderermain"); |
| 1479 #ifdef NDEBUG | 1479 #ifdef NDEBUG |
| 1480 PrintPerfTestResults(pre_read_chrome_monitor, kNumCycles, "PreReadImage"); | 1480 PrintPerfTestResults(pre_read_chrome_monitor, kNumCycles, "PreReadImage"); |
| 1481 #endif // NDEBUG | 1481 #endif // NDEBUG |
| 1482 } | 1482 } |
| OLD | NEW |