summaryrefslogtreecommitdiffstats
path: root/chrome/test/automation
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/test/automation')
-rw-r--r--chrome/test/automation/automation_messages_internal.h7
-rw-r--r--chrome/test/automation/automation_proxy.cc5
-rw-r--r--chrome/test/automation/automation_proxy.h15
3 files changed, 21 insertions, 6 deletions
diff --git a/chrome/test/automation/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h
index 174e1d0..69e9c51 100644
--- a/chrome/test/automation/automation_messages_internal.h
+++ b/chrome/test/automation/automation_messages_internal.h
@@ -906,7 +906,10 @@ IPC_BEGIN_MESSAGES(Automation)
// Used to put the browser into "extension automation mode" for the
// current profile, or turn off the mode.
IPC_MESSAGE_ROUTED1(AutomationMsg_SetEnableExtensionAutomation,
- bool /* true to enable extension automation */)
+ std::vector<std::string> /* empty to disable automation,
+ non-empty to enable automation
+ of the specified API
+ functions */)
// This message tells the browser to start using the new proxy configuration
// represented by the given JSON string. The parameters used in the JSON
@@ -1065,7 +1068,7 @@ IPC_BEGIN_MESSAGES(Automation)
AutomationMsg_GoForwardBlockUntilNavigationsComplete, int, int,
AutomationMsg_NavigationResponseValues)
- // This message is used by automaton clients to upload histogram data to the
+ // This message is used by automation clients to upload histogram data to the
// browser process.
IPC_MESSAGE_ROUTED1(AutomationMsg_RecordHistograms,
std::vector<std::string> /* histogram_list */)
diff --git a/chrome/test/automation/automation_proxy.cc b/chrome/test/automation/automation_proxy.cc
index 28cfe37..4658bf3 100644
--- a/chrome/test/automation/automation_proxy.cc
+++ b/chrome/test/automation/automation_proxy.cc
@@ -220,9 +220,10 @@ bool AutomationProxy::SavePackageShouldPromptUser(bool should_prompt) {
return Send(new AutomationMsg_SavePackageShouldPromptUser(0, should_prompt));
}
-bool AutomationProxy::SetEnableExtensionAutomation(bool enable_automation) {
+bool AutomationProxy::SetEnableExtensionAutomation(
+ const std::vector<std::string>& functions_enabled) {
return Send(
- new AutomationMsg_SetEnableExtensionAutomation(0, enable_automation));
+ new AutomationMsg_SetEnableExtensionAutomation(0, functions_enabled));
}
bool AutomationProxy::GetBrowserWindowCount(int* num_windows) {
diff --git a/chrome/test/automation/automation_proxy.h b/chrome/test/automation/automation_proxy.h
index 1e02cff..cf40606 100644
--- a/chrome/test/automation/automation_proxy.h
+++ b/chrome/test/automation/automation_proxy.h
@@ -180,11 +180,22 @@ class AutomationProxy : public IPC::Channel::Listener,
// sent.
bool SavePackageShouldPromptUser(bool should_prompt);
- // Turn extension automation mode on and off. When extension automation
+ // Configure extension automation mode. When extension automation
// mode is turned on, the automation host can overtake extension API calls
// e.g. to make UI tests for extensions easier to write. Returns true if
// the message is successfully sent.
- bool SetEnableExtensionAutomation(bool enable_automation);
+ //
+ // The parameter can take the following types of values:
+ // a) An empty list to turn off extension automation.
+ // b) A list with one item, "*", to turn extension automation on for all
+ // functions.
+ // c) A list with one or more items which are the names of Chrome Extension
+ // API functions that should be forwarded over the automation interface.
+ // Other functions will continue to be fulfilled as normal. This lets you
+ // write tests where some functionality continues to function as normal,
+ // and other functionality is mocked out by the test.
+ bool SetEnableExtensionAutomation(
+ const std::vector<std::string>& functions_enabled);
// Returns the ID of the automation IPC channel, so that it can be
// passed to the app as a launch parameter.