summaryrefslogtreecommitdiffstats
path: root/chrome_frame/chrome_frame_npapi.cc
diff options
context:
space:
mode:
authorjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-23 19:16:20 +0000
committerjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-23 19:16:20 +0000
commit50f53164ebbceb30b69578e96e863375f5cb4f9b (patch)
tree853541075c0a2ac5adb3d4f3a389401d92405edf /chrome_frame/chrome_frame_npapi.cc
parent117fd71c37c932c5ffcbf59eb42d118d3dfb431f (diff)
downloadchromium_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_frame/chrome_frame_npapi.cc')
-rw-r--r--chrome_frame/chrome_frame_npapi.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/chrome_frame/chrome_frame_npapi.cc b/chrome_frame/chrome_frame_npapi.cc
index 6c9791f..ec324e0 100644
--- a/chrome_frame/chrome_frame_npapi.cc
+++ b/chrome_frame/chrome_frame_npapi.cc
@@ -102,6 +102,10 @@ static const char kPluginChromeExtraArguments[] = "chrome_extra_arguments";
// If privileged mode is enabled, the string value of this argument will
// be used as the profile name for our chrome.exe instance.
static const char kPluginChromeProfileName[] = "chrome_profile_name";
+// If privileged mode is enabled, this argument will be taken as a
+// comma-separated list of API function calls to automate.
+static const char kPluginChromeFunctionsAutomatedAttribute[] =
+ "chrome_functions_automated";
// If chrome network stack is to be used
static const char kPluginUseChromeNetwork[] = "usechromenetwork";
@@ -377,6 +381,13 @@ bool ChromeFrameNPAPI::Initialize(NPMIMEType mime_type, NPP instance,
chrome_extra_arguments_arg = argv[i];
} else if (LowerCaseEqualsASCII(argn[i], kPluginChromeProfileName)) {
chrome_profile_name_arg = argv[i];
+ } else if (LowerCaseEqualsASCII(argn[i],
+ kPluginChromeFunctionsAutomatedAttribute)) {
+ functions_enabled_.clear();
+ // SplitString writes one empty entry for blank strings, so we need this
+ // to allow specifying zero automation of API functions.
+ if (argv[i][0] != '\0')
+ SplitString(argv[i], ',', &functions_enabled_);
} else if (LowerCaseEqualsASCII(argn[i], kPluginUseChromeNetwork)) {
chrome_network_arg_set = true;
chrome_network_arg = atoi(argv[i]) ? true : false;