Commit 272e5310 authored by ananta@chromium.org's avatar ananta@chromium.org

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
parent 7a1d7985
......@@ -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());
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment