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

Unified Diff: base/command_line.cc

Issue 2876153002: Support Using ScopedFeatureList in BrowserTest (Closed)
Patch Set: ilya's comments addressed Created 3 years, 6 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
Index: base/command_line.cc
diff --git a/base/command_line.cc b/base/command_line.cc
index 873da813483651bc9e74b0510e17fa925225b5bd..1b319ec814f3782c28d45936265cb2b8818b7f57 100644
--- a/base/command_line.cc
+++ b/base/command_line.cc
@@ -365,6 +365,20 @@ void CommandLine::AppendSwitchASCII(const std::string& switch_string,
#endif
}
+void CommandLine::RemoveSwitchASCIIForTesting(
+ const std::string& switch_string) {
+#if defined(OS_WIN)
+ const std::string switch_key = ToLowerASCII(switch_string);
+ StringType combined_switch_string(ASCIIToUTF16(switch_key));
+#elif defined(OS_POSIX)
+ const std::string& switch_key = switch_string;
+ StringType combined_switch_string(switch_key);
+#endif
Ilya Sherman 2017/06/07 21:32:36 These few lines are duplicated from above. Please
+ size_t prefix_length = GetSwitchPrefixLength(combined_switch_string);
+ switches_by_stringpiece_.erase(switch_key.substr(prefix_length));
+ switches_.erase(switch_string.substr(prefix_length));
Ilya Sherman 2017/06/07 21:32:36 Does argv_ need to be updated as well? (I am not
+}
+
void CommandLine::CopySwitchesFrom(const CommandLine& source,
const char* const switches[],
size_t count) {

Powered by Google App Engine
This is Rietveld 408576698