summaryrefslogtreecommitdiffstats
path: root/chrome_frame
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-19 03:15:32 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-19 03:15:32 +0000
commit272e5310f4f7ae8b899191a2284114f94041631e (patch)
tree89b4b551db3171f6c539ed252f21db7d4f0777c1 /chrome_frame
parent7a1d798531c80bacc0b7fd785890e8e13624adde (diff)
downloadchromium_src-272e5310f4f7ae8b899191a2284114f94041631e.zip
chromium_src-272e5310f4f7ae8b899191a2284114f94041631e.tar.gz
chromium_src-272e5310f4f7ae8b899191a2284114f94041631e.tar.bz2
More ChromeFrame perf test fixes to account for the changes in the UITest functions which
return the chrome browser process pid. In ChromeFrame we don't use the launcher which results in a crash while running a number of perf tests. Added a helper function to return the browser pid. Added a handler for intercepting and debugging pure call errors in chrome frame perf tests. BUG=none TEST=ChromeFrame perf tests should run to completion. TBR=amit Review URL: http://codereview.chromium.org/6306004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71755 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r--chrome_frame/test/perf/chrome_frame_perftest.cc18
-rw-r--r--chrome_frame/test/perf/run_all.cc6
2 files changed, 20 insertions, 4 deletions
diff --git a/chrome_frame/test/perf/chrome_frame_perftest.cc b/chrome_frame/test/perf/chrome_frame_perftest.cc
index 2bc39b7..e59c843 100644
--- a/chrome_frame/test/perf/chrome_frame_perftest.cc
+++ b/chrome_frame/test/perf/chrome_frame_perftest.cc
@@ -658,10 +658,20 @@ class ChromeFrameMemoryTest : public ChromeFramePerfTestBase {
printf("\n");
}
+ base::ProcessId chrome_browser_process_id() {
+ base::NamedProcessIterator iter(L"chrome.exe", NULL);
+ const base::ProcessEntry* entry = iter.NextProcessEntry();
+ if (entry) {
+ return entry->pid();
+ }
+ return -1;
+ }
+
ChromeProcessList GetBrowserChildren() {
- ChromeProcessList list = GetRunningChromeProcesses(browser_process_id());
+ ChromeProcessList list = GetRunningChromeProcesses(
+ chrome_browser_process_id());
ChromeProcessList::iterator browser =
- std::find(list.begin(), list.end(), browser_process_id());
+ std::find(list.begin(), list.end(), chrome_browser_process_id());
if (browser != list.end()) {
list.erase(browser);
}
@@ -670,7 +680,7 @@ class ChromeFrameMemoryTest : public ChromeFramePerfTestBase {
void AccountProcessMemoryUsage(DWORD process_id) {
ProcessMemoryInfo process_memory_info(
- process_id, process_id == browser_process_id(), this);
+ process_id, process_id == chrome_browser_process_id(), this);
ASSERT_TRUE(process_memory_info.GetMemoryConsumptionDetails());
@@ -824,7 +834,7 @@ class ChromeFrameActiveXMemoryTest : public MemoryTestBase {
// redirect.
if (!test_completed_) {
// Measure memory usage for the browser process.
- AccountProcessMemoryUsage(browser_process_id());
+ AccountProcessMemoryUsage(chrome_browser_process_id());
// Measure memory usage for the current process.
AccountProcessMemoryUsage(GetCurrentProcessId());
diff --git a/chrome_frame/test/perf/run_all.cc b/chrome_frame/test/perf/run_all.cc
index 01dda7c..7d66299 100644
--- a/chrome_frame/test/perf/run_all.cc
+++ b/chrome_frame/test/perf/run_all.cc
@@ -10,11 +10,17 @@
#include "chrome_frame/test_utils.h"
#include "chrome_frame/utils.h"
+void PureCall() {
+ __debugbreak();
+}
+
int main(int argc, char **argv) {
base::PerfTestSuite perf_suite(argc, argv);
chrome::RegisterPathProvider();
base::PlatformThread::SetName("ChromeFrame perf tests");
+ _set_purecall_handler(PureCall);
+
SetConfigBool(kChromeFrameHeadlessMode, true);
SetConfigBool(kChromeFrameUnpinnedMode, true);