Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2818)

Unified Diff: chrome/test/automation/proxy_launcher.cc

Issue 7005007: Add an alternative way to specify extra chrome flags via env for testing (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/pyautolib/pyauto.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/automation/proxy_launcher.cc
===================================================================
--- chrome/test/automation/proxy_launcher.cc (revision 84824)
+++ chrome/test/automation/proxy_launcher.cc (working copy)
@@ -5,6 +5,7 @@
#include "chrome/test/automation/proxy_launcher.h"
#include "app/sql/connection.h"
+#include "base/environment.h"
#include "base/file_util.h"
#include "base/string_number_conversions.h"
#include "base/string_split.h"
@@ -364,13 +365,23 @@
CommandLine::ForCurrentProcess()->GetSwitchValueNative(
switches::kExtraChromeFlags);
if (!extra_chrome_flags.empty()) {
- // Split by spaces and append to command line
+ // Split by spaces and append to command line.
std::vector<CommandLine::StringType> flags;
- base::SplitString(extra_chrome_flags, ' ', &flags);
+ base::SplitStringAlongWhitespace(extra_chrome_flags, &flags);
for (size_t i = 0; i < flags.size(); ++i)
command_line->AppendArgNative(flags[i]);
}
+ // Also look for extra flags in environment.
+ scoped_ptr<base::Environment> env(base::Environment::Create());
+ std::string extra_from_env;
+ if (env->GetVar("EXTRA_CHROME_FLAGS", &extra_from_env)) {
+ std::vector<std::string> flags;
+ base::SplitStringAlongWhitespace(extra_from_env, &flags);
+ for (size_t i = 0; i < flags.size(); ++i)
+ command_line->AppendArg(flags[i]);
+ }
+
// No default browser check, it would create an info-bar (if we are not the
// default browser) that could conflicts with some tests expectations.
command_line->AppendSwitch(switches::kNoDefaultBrowserCheck);
« no previous file with comments | « no previous file | chrome/test/pyautolib/pyauto.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698