summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation/testing_automation_provider.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/automation/testing_automation_provider.cc')
-rw-r--r--chrome/browser/automation/testing_automation_provider.cc13
1 files changed, 13 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