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

Unified Diff: base/command_line.cc

Issue 2078913005: Add a chrome_elf_unittest ChromeElfLoadSanityTest which validates that loading chrome_elf does not … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove braces Created 4 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
« no previous file with comments | « base/command_line.h ('k') | base/message_loop/message_pump_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/command_line.cc
diff --git a/base/command_line.cc b/base/command_line.cc
index c991959d6911bf545f994b3e6d0833f793cc7cf0..99ea2b000324b87ea4ab11bae1f7c5374586331c 100644
--- a/base/command_line.cc
+++ b/base/command_line.cc
@@ -197,6 +197,17 @@ void CommandLine::set_slash_is_not_a_switch() {
DCHECK_EQ(wcscmp(kSwitchPrefixes[arraysize(kSwitchPrefixes) - 1], L"/"), 0);
switch_prefix_count = arraysize(kSwitchPrefixes) - 1;
}
+
+// static
+void CommandLine::InitUsingArgvForTesting(int argc, const char* const* argv) {
+ DCHECK(!current_process_commandline_);
+ current_process_commandline_ = new CommandLine(NO_PROGRAM);
+ // On Windows we need to convert the command line arguments to string16.
+ base::CommandLine::StringVector argv_vector;
+ for (int i = 0; i < argc; ++i)
+ argv_vector.push_back(UTF8ToUTF16(argv[i]));
+ current_process_commandline_->InitFromArgv(argv_vector);
+}
#endif
// static
« no previous file with comments | « base/command_line.h ('k') | base/message_loop/message_pump_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698