diff options
author | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-28 00:51:42 +0000 |
---|---|---|
committer | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-28 00:51:42 +0000 |
commit | 23c6c2b0988fee9b5d0c9eb3565b41cfd1afb940 (patch) | |
tree | ab5076f8c9b869383cf55686f1b7268d048488e9 /chrome/browser/automation | |
parent | c66f58a78b49eaa7856f2b6459fd57e1b792eb8d (diff) | |
download | chromium_src-23c6c2b0988fee9b5d0c9eb3565b41cfd1afb940.zip chromium_src-23c6c2b0988fee9b5d0c9eb3565b41cfd1afb940.tar.gz chromium_src-23c6c2b0988fee9b5d0c9eb3565b41cfd1afb940.tar.bz2 |
[Mac] Add a perf test that counts the number of Mach ports in the browser.
BUG=105513
TEST=This is one.
Review URL: http://codereview.chromium.org/9193024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119541 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation')
-rw-r--r-- | chrome/browser/automation/testing_automation_provider.cc | 13 | ||||
-rw-r--r-- | chrome/browser/automation/testing_automation_provider.h | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc index b8e76e5..ed0f89b 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -154,6 +154,10 @@ #include "chrome/browser/download/download_shelf.h" #endif +#if defined(OS_MACOSX) +#include "base/mach_ipc_mac.h" +#endif + using automation::Error; using automation::ErrorCode; using automation_util::SendErrorIfModalDialogActive; @@ -321,6 +325,7 @@ bool TestingAutomationProvider::OnMessageReceived( IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_AppendTab, AppendTab) IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_AppendBackgroundTab, AppendBackgroundTab) + IPC_MESSAGE_HANDLER(AutomationMsg_GetMachPortCount, GetMachPortCount) IPC_MESSAGE_HANDLER(AutomationMsg_ActiveTabIndex, GetActiveTabIndex) IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_CloseTab, CloseTab) IPC_MESSAGE_HANDLER(AutomationMsg_GetCookies, GetCookies) @@ -601,6 +606,14 @@ void TestingAutomationProvider::AppendBackgroundTab( } } +void TestingAutomationProvider::GetMachPortCount(int* port_count) { +#if defined(OS_MACOSX) + base::mac::GetNumberOfMachPorts(mach_task_self(), port_count); +#else + *port_count = 0; +#endif +} + void TestingAutomationProvider::GetActiveTabIndex(int handle, int* active_tab_index) { *active_tab_index = -1; // -1 is the error code diff --git a/chrome/browser/automation/testing_automation_provider.h b/chrome/browser/automation/testing_automation_provider.h index 5b25242..e6f9092 100644 --- a/chrome/browser/automation/testing_automation_provider.h +++ b/chrome/browser/automation/testing_automation_provider.h @@ -89,6 +89,7 @@ class TestingAutomationProvider : public AutomationProvider, void AppendTab(int handle, const GURL& url, IPC::Message* reply_message); void AppendBackgroundTab(int handle, const GURL& url, IPC::Message* reply_message); + void GetMachPortCount(int* port_count); void GetActiveTabIndex(int handle, int* active_tab_index); void CloseTab(int tab_handle, bool wait_until_closed, IPC::Message* reply_message); |