| 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> |
| 11 | 11 |
| 12 #include "chrome_tab.h" // Generated from chrome_tab.idl. | 12 #include "chrome_tab.h" // Generated from chrome_tab.idl. |
| 13 | 13 |
| 14 #include "base/event_trace_controller_win.h" | 14 #include "base/event_trace_controller_win.h" |
| 15 #include "base/event_trace_consumer_win.h" | 15 #include "base/event_trace_consumer_win.h" |
| 16 #include "base/file_path.h" | 16 #include "base/file_path.h" |
| 17 #include "base/file_util.h" | 17 #include "base/file_util.h" |
| 18 #include "base/path_service.h" | 18 #include "base/path_service.h" |
| 19 #include "base/process_util.h" | 19 #include "base/process_util.h" |
| 20 #include "base/registry.h" | |
| 21 #include "base/scoped_ptr.h" | 20 #include "base/scoped_ptr.h" |
| 22 #include "base/scoped_bstr_win.h" | 21 #include "base/scoped_bstr_win.h" |
| 23 #include "base/scoped_comptr_win.h" | 22 #include "base/scoped_comptr_win.h" |
| 24 #include "base/scoped_variant_win.h" | 23 #include "base/scoped_variant_win.h" |
| 25 #include "base/string_util.h" | 24 #include "base/string_util.h" |
| 26 #include "base/stringprintf.h" | 25 #include "base/stringprintf.h" |
| 27 #include "base/time.h" | 26 #include "base/time.h" |
| 28 #include "base/trace_event_win.h" | 27 #include "base/trace_event_win.h" |
| 29 #include "base/utf_string_conversions.h" | 28 #include "base/utf_string_conversions.h" |
| 29 #include "base/win/registry.h" |
| 30 #include "chrome/common/chrome_constants.h" | 30 #include "chrome/common/chrome_constants.h" |
| 31 #include "chrome/common/chrome_paths.h" | 31 #include "chrome/common/chrome_paths.h" |
| 32 #include "chrome/common/chrome_paths_internal.h" | 32 #include "chrome/common/chrome_paths_internal.h" |
| 33 #include "chrome/test/chrome_process_util.h" | 33 #include "chrome/test/chrome_process_util.h" |
| 34 #include "chrome/test/ui/ui_perf_test.h" | 34 #include "chrome/test/ui/ui_perf_test.h" |
| 35 | 35 |
| 36 #include "chrome_frame/test_utils.h" | 36 #include "chrome_frame/test_utils.h" |
| 37 #include "chrome_frame/utils.h" | 37 #include "chrome_frame/utils.h" |
| 38 | 38 |
| 39 const wchar_t kSilverlightControlKey[] = | 39 const wchar_t kSilverlightControlKey[] = |
| (...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1085 RunStartupTest("creation_cold", "t", "", true /* cold */, | 1085 RunStartupTest("creation_cold", "t", "", true /* cold */, |
| 1086 arraysize(binaries_to_evict), binaries_to_evict, | 1086 arraysize(binaries_to_evict), binaries_to_evict, |
| 1087 true /* important */, false); | 1087 true /* important */, false); |
| 1088 } | 1088 } |
| 1089 | 1089 |
| 1090 // Attempt to evict the Flash control can fail on the buildbot as the dll | 1090 // Attempt to evict the Flash control can fail on the buildbot as the dll |
| 1091 // is marked read only. The test run is aborted if we fail to evict the file | 1091 // is marked read only. The test run is aborted if we fail to evict the file |
| 1092 // from the cache. This could also fail if the Flash control is in use. | 1092 // from the cache. This could also fail if the Flash control is in use. |
| 1093 // On Vista this could fail because of UAC | 1093 // On Vista this could fail because of UAC |
| 1094 TEST_F(FlashCreationTest, PerfCold) { | 1094 TEST_F(FlashCreationTest, PerfCold) { |
| 1095 RegKey flash_key(HKEY_CLASSES_ROOT, kFlashControlKey, KEY_READ); | 1095 base::win::RegKey flash_key(HKEY_CLASSES_ROOT, kFlashControlKey, KEY_READ); |
| 1096 | 1096 |
| 1097 std::wstring plugin_path; | 1097 std::wstring plugin_path; |
| 1098 ASSERT_TRUE(flash_key.ReadValue(L"", &plugin_path)); | 1098 ASSERT_TRUE(flash_key.ReadValue(L"", &plugin_path)); |
| 1099 ASSERT_FALSE(plugin_path.empty()); | 1099 ASSERT_FALSE(plugin_path.empty()); |
| 1100 | 1100 |
| 1101 FilePath flash_path = FilePath::FromWStringHack(plugin_path); | 1101 FilePath flash_path = FilePath::FromWStringHack(plugin_path); |
| 1102 FilePath binaries_to_evict[] = {flash_path}; | 1102 FilePath binaries_to_evict[] = {flash_path}; |
| 1103 | 1103 |
| 1104 RunStartupTest("creation_cold", "t_flash", "", true /* cold */, | 1104 RunStartupTest("creation_cold", "t_flash", "", true /* cold */, |
| 1105 arraysize(binaries_to_evict), binaries_to_evict, | 1105 arraysize(binaries_to_evict), binaries_to_evict, |
| 1106 false/* important */, true); | 1106 false/* important */, true); |
| 1107 } | 1107 } |
| 1108 | 1108 |
| 1109 // This test would fail on Vista due to UAC or if the Silverlight control is | 1109 // This test would fail on Vista due to UAC or if the Silverlight control is |
| 1110 // in use. The test run is aborted if we fail to evict the file from the cache. | 1110 // in use. The test run is aborted if we fail to evict the file from the cache. |
| 1111 // Disabling this test as the Silverlight dll does not seem to get unloaded | 1111 // Disabling this test as the Silverlight dll does not seem to get unloaded |
| 1112 // correctly causing the attempt to evict the dll from the system cache to | 1112 // correctly causing the attempt to evict the dll from the system cache to |
| 1113 // fail. | 1113 // fail. |
| 1114 TEST_F(SilverlightCreationTest, DISABLED_PerfCold) { | 1114 TEST_F(SilverlightCreationTest, DISABLED_PerfCold) { |
| 1115 RegKey silverlight_key(HKEY_CLASSES_ROOT, kSilverlightControlKey, KEY_READ); | 1115 base::win::RegKey silverlight_key(HKEY_CLASSES_ROOT, kSilverlightControlKey, |
| 1116 KEY_READ); |
| 1116 | 1117 |
| 1117 std::wstring plugin_path; | 1118 std::wstring plugin_path; |
| 1118 ASSERT_TRUE(silverlight_key.ReadValue(L"", &plugin_path)); | 1119 ASSERT_TRUE(silverlight_key.ReadValue(L"", &plugin_path)); |
| 1119 ASSERT_FALSE(plugin_path.empty()); | 1120 ASSERT_FALSE(plugin_path.empty()); |
| 1120 | 1121 |
| 1121 FilePath silverlight_path = FilePath::FromWStringHack(plugin_path); | 1122 FilePath silverlight_path = FilePath::FromWStringHack(plugin_path); |
| 1122 FilePath binaries_to_evict[] = {silverlight_path}; | 1123 FilePath binaries_to_evict[] = {silverlight_path}; |
| 1123 | 1124 |
| 1124 RunStartupTest("creation_cold", "t_silverlight", "", true /* cold */, | 1125 RunStartupTest("creation_cold", "t_silverlight", "", true /* cold */, |
| 1125 arraysize(binaries_to_evict), binaries_to_evict, | 1126 arraysize(binaries_to_evict), binaries_to_evict, |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1455 PrintPerfTestResults(automation_provider_connect_monitor, kNumCycles, | 1456 PrintPerfTestResults(automation_provider_connect_monitor, kNumCycles, |
| 1456 "automationproviderconnect"); | 1457 "automationproviderconnect"); |
| 1457 PrintPerfTestResults(external_tab_navigate_monitor, kNumCycles, | 1458 PrintPerfTestResults(external_tab_navigate_monitor, kNumCycles, |
| 1458 "externaltabnavigate"); | 1459 "externaltabnavigate"); |
| 1459 PrintPerfTestResults(renderer_main_monitor, kNumCycles, | 1460 PrintPerfTestResults(renderer_main_monitor, kNumCycles, |
| 1460 "beginrenderermain"); | 1461 "beginrenderermain"); |
| 1461 #ifdef NDEBUG | 1462 #ifdef NDEBUG |
| 1462 PrintPerfTestResults(pre_read_chrome_monitor, kNumCycles, "PreReadImage"); | 1463 PrintPerfTestResults(pre_read_chrome_monitor, kNumCycles, "PreReadImage"); |
| 1463 #endif // NDEBUG | 1464 #endif // NDEBUG |
| 1464 } | 1465 } |
| OLD | NEW |