| 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 "chrome_frame/test/perf/chrome_frame_perftest.h" | 5 #include "chrome_frame/test/perf/chrome_frame_perftest.h" |
| 6 | 6 |
| 7 #include <atlhost.h> | 7 #include <atlhost.h> |
| 8 #include <atlwin.h> | 8 #include <atlwin.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 952 // change in paging behaviour between raw loading and pre-reading. | 952 // change in paging behaviour between raw loading and pre-reading. |
| 953 | 953 |
| 954 // TODO(rogerm): Add checks to the *PreReadImage* tests to validate the | 954 // TODO(rogerm): Add checks to the *PreReadImage* tests to validate the |
| 955 // handling of invalid pe files and paths as input. | 955 // handling of invalid pe files and paths as input. |
| 956 | 956 |
| 957 TEST(ImagePreReader, PreReadImage) { | 957 TEST(ImagePreReader, PreReadImage) { |
| 958 base::FilePath current_exe; | 958 base::FilePath current_exe; |
| 959 ASSERT_TRUE(PathService::Get(base::FILE_EXE, ¤t_exe)); | 959 ASSERT_TRUE(PathService::Get(base::FILE_EXE, ¤t_exe)); |
| 960 | 960 |
| 961 int64 file_size_64 = 0; | 961 int64 file_size_64 = 0; |
| 962 ASSERT_TRUE(file_util::GetFileSize(current_exe, &file_size_64)); | 962 ASSERT_TRUE(base::GetFileSize(current_exe, &file_size_64)); |
| 963 ASSERT_TRUE(file_size_64 < std::numeric_limits<std::size_t>::max()); | 963 ASSERT_TRUE(file_size_64 < std::numeric_limits<std::size_t>::max()); |
| 964 size_t file_size = static_cast<size_t>(file_size_64); | 964 size_t file_size = static_cast<size_t>(file_size_64); |
| 965 | 965 |
| 966 const wchar_t* module_path = current_exe.value().c_str(); | 966 const wchar_t* module_path = current_exe.value().c_str(); |
| 967 const size_t kStepSize = 2 * 1024 * 1024; | 967 const size_t kStepSize = 2 * 1024 * 1024; |
| 968 | 968 |
| 969 ASSERT_TRUE( | 969 ASSERT_TRUE( |
| 970 ImagePreReader::PreReadImage(module_path, 0, kStepSize)); | 970 ImagePreReader::PreReadImage(module_path, 0, kStepSize)); |
| 971 ASSERT_TRUE( | 971 ASSERT_TRUE( |
| 972 ImagePreReader::PreReadImage(module_path, file_size / 4, kStepSize)); | 972 ImagePreReader::PreReadImage(module_path, file_size / 4, kStepSize)); |
| (...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1602 PrintPerfTestResults(automation_provider_connect_monitor, kNumCycles, | 1602 PrintPerfTestResults(automation_provider_connect_monitor, kNumCycles, |
| 1603 "automationproviderconnect"); | 1603 "automationproviderconnect"); |
| 1604 PrintPerfTestResults(external_tab_navigate_monitor, kNumCycles, | 1604 PrintPerfTestResults(external_tab_navigate_monitor, kNumCycles, |
| 1605 "externaltabnavigate"); | 1605 "externaltabnavigate"); |
| 1606 PrintPerfTestResults(renderer_main_monitor, kNumCycles, | 1606 PrintPerfTestResults(renderer_main_monitor, kNumCycles, |
| 1607 "beginrenderermain"); | 1607 "beginrenderermain"); |
| 1608 #ifdef NDEBUG | 1608 #ifdef NDEBUG |
| 1609 PrintPerfTestResults(pre_read_chrome_monitor, kNumCycles, "PreReadImage"); | 1609 PrintPerfTestResults(pre_read_chrome_monitor, kNumCycles, "PreReadImage"); |
| 1610 #endif // NDEBUG | 1610 #endif // NDEBUG |
| 1611 } | 1611 } |
| OLD | NEW |