Index: base/command_line.cc |
diff --git a/base/command_line.cc b/base/command_line.cc |
index 873da813483651bc9e74b0510e17fa925225b5bd..806e40d8e62be36ad6cf3f1747cb3258bc8f547d 100644 |
--- a/base/command_line.cc |
+++ b/base/command_line.cc |
@@ -365,6 +365,22 @@ void CommandLine::AppendSwitchASCII(const std::string& switch_string, |
#endif |
} |
+void CommandLine::ReplaceSwitchASCIIForTesting(const std::string& switch_string, |
+ const std::string& value) { |
+#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 |
+ size_t prefix_length = GetSwitchPrefixLength(combined_switch_string); |
+ switches_by_stringpiece_.erase(switch_key.substr(prefix_length)); |
+ switches_.erase(switch_string.substr(prefix_length)); |
+ |
+ AppendSwitchASCII(switch_string, value); |
+} |
+ |
void CommandLine::CopySwitchesFrom(const CommandLine& source, |
const char* const switches[], |
size_t count) { |