OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/file_util.h" | 14 #include "base/file_util.h" |
15 #include "base/registry.h" | 15 #include "base/registry.h" |
16 #include "base/scoped_ptr.h" | 16 #include "base/scoped_ptr.h" |
17 #include "base/scoped_bstr_win.h" | 17 #include "base/scoped_bstr_win.h" |
18 #include "base/scoped_comptr_win.h" | 18 #include "base/scoped_comptr_win.h" |
19 #include "base/string_util.h" | 19 #include "base/string_util.h" |
20 #include "base/time.h" | 20 #include "base/time.h" |
21 #include "chrome/common/chrome_constants.h" | 21 #include "chrome/common/chrome_constants.h" |
22 #include "chrome/common/chrome_paths.h" | 22 #include "chrome/common/chrome_paths.h" |
| 23 #include "chrome/common/chrome_paths_internal.h" |
23 #include "chrome/test/chrome_process_util.h" | 24 #include "chrome/test/chrome_process_util.h" |
24 #include "chrome/test/perf/mem_usage.h" | 25 #include "chrome/test/perf/mem_usage.h" |
25 #include "chrome/test/ui/ui_test.h" | 26 #include "chrome/test/ui/ui_test.h" |
26 | 27 |
27 #include "chrome_frame/test_utils.h" | 28 #include "chrome_frame/test_utils.h" |
28 #include "chrome_frame/utils.h" | 29 #include "chrome_frame/utils.h" |
29 | 30 |
30 const wchar_t kSilverlightControlKey[] = | 31 const wchar_t kSilverlightControlKey[] = |
31 L"CLSID\\{DFEAF541-F3E1-4c24-ACAC-99C30715084A}\\InprocServer32"; | 32 L"CLSID\\{DFEAF541-F3E1-4c24-ACAC-99C30715084A}\\InprocServer32"; |
32 | 33 |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 } | 632 } |
632 | 633 |
633 EXPECT_TRUE( | 634 EXPECT_TRUE( |
634 file_util::PathExists(FilePath::FromWStringHack(chrome_exe_test_path))); | 635 file_util::PathExists(FilePath::FromWStringHack(chrome_exe_test_path))); |
635 | 636 |
636 return chrome_exe_path; | 637 return chrome_exe_path; |
637 } | 638 } |
638 | 639 |
639 void InitiateNextNavigation() { | 640 void InitiateNextNavigation() { |
640 if (browser_pid_ == 0) { | 641 if (browser_pid_ == 0) { |
641 std::wstring profile_directory; | 642 FilePath profile_directory; |
642 if (GetUserProfileBaseDirectory(&profile_directory)) { | 643 if (chrome::GetChromeFrameUserDataDirectory(&user_data_dir_)) { |
643 file_util::AppendToPath(&profile_directory, | 644 user_data_dir_ = user_data_dir_.Append(GetHostProcessName(false)); |
644 GetHostProcessName(false)); | |
645 } | 645 } |
646 | 646 |
647 user_data_dir_ = FilePath::FromWStringHack(profile_directory); | |
648 browser_pid_ = ChromeBrowserProcessId(user_data_dir_); | 647 browser_pid_ = ChromeBrowserProcessId(user_data_dir_); |
649 } | 648 } |
650 | 649 |
651 EXPECT_TRUE(static_cast<int>(browser_pid_) > 0); | 650 EXPECT_TRUE(static_cast<int>(browser_pid_) > 0); |
652 | 651 |
653 // Get the memory consumption information for the child processes | 652 // Get the memory consumption information for the child processes |
654 // of the chrome browser. | 653 // of the chrome browser. |
655 ChromeProcessList child_processes = GetBrowserChildren(); | 654 ChromeProcessList child_processes = GetBrowserChildren(); |
656 ChromeProcessList::iterator index; | 655 ChromeProcessList::iterator index; |
657 for (index = child_processes.begin(); index != child_processes.end(); | 656 for (index = child_processes.begin(); index != child_processes.end(); |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1130 ASSERT_TRUE(silverlight_key.ReadValue(L"", &plugin_path)); | 1129 ASSERT_TRUE(silverlight_key.ReadValue(L"", &plugin_path)); |
1131 ASSERT_FALSE(plugin_path.empty()); | 1130 ASSERT_FALSE(plugin_path.empty()); |
1132 | 1131 |
1133 FilePath silverlight_path = FilePath::FromWStringHack(plugin_path); | 1132 FilePath silverlight_path = FilePath::FromWStringHack(plugin_path); |
1134 FilePath binaries_to_evict[] = {silverlight_path}; | 1133 FilePath binaries_to_evict[] = {silverlight_path}; |
1135 | 1134 |
1136 RunStartupTest("creation_cold", "t_silverlight", "", true /* cold */, | 1135 RunStartupTest("creation_cold", "t_silverlight", "", true /* cold */, |
1137 arraysize(binaries_to_evict), binaries_to_evict, | 1136 arraysize(binaries_to_evict), binaries_to_evict, |
1138 false /* important */, true); | 1137 false /* important */, true); |
1139 } | 1138 } |
OLD | NEW |