diff options
author | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-23 19:16:20 +0000 |
---|---|---|
committer | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-23 19:16:20 +0000 |
commit | 50f53164ebbceb30b69578e96e863375f5cb4f9b (patch) | |
tree | 853541075c0a2ac5adb3d4f3a389401d92405edf /chrome/browser/automation/automation_extension_function.h | |
parent | 117fd71c37c932c5ffcbf59eb42d118d3dfb431f (diff) | |
download | chromium_src-50f53164ebbceb30b69578e96e863375f5cb4f9b.zip chromium_src-50f53164ebbceb30b69578e96e863375f5cb4f9b.tar.gz chromium_src-50f53164ebbceb30b69578e96e863375f5cb4f9b.tar.bz2 |
Enhance extension UI testing by enabling you to select which extension
APIs to forward (and thus stub out in your test), while others will
keep being fulfilled as per usual. This lets you build tests that
stub out one piece of behavior while testing that some side effects of
another API happen as expected.
BUG=none
TEST=Run ui_tests.exe
Review URL: http://codereview.chromium.org/314015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29919 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation/automation_extension_function.h')
-rw-r--r-- | chrome/browser/automation/automation_extension_function.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/chrome/browser/automation/automation_extension_function.h b/chrome/browser/automation/automation_extension_function.h index f48adff..d6fac7d 100644 --- a/chrome/browser/automation/automation_extension_function.h +++ b/chrome/browser/automation/automation_extension_function.h @@ -27,10 +27,14 @@ class AutomationExtensionFunction : public ExtensionFunction { static ExtensionFunction* Factory(); - // If enabled, we set an instance of this function as the functor - // for all function names in ExtensionFunctionFactoryRegistry. - // If disabled, we restore the initial functions. - static void SetEnabled(bool enabled); + // If the list of enabled functions is non-empty, we enable according to the + // list ("*" means enable all, otherwise we enable individual named + // functions). If empty, we restore the initial functions. + // + // Note that all calls to this function, except a call with the empty list, + // are additive. Functions previously enabled will remain enabled until + // you clear all function forwarding by specifying the empty list. + static void SetEnabled(const std::vector<std::string>& functions_enabled); // Intercepts messages sent from the external host to check if they // are actually responses to extension API calls. If they are, redirects |