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

Unified Diff: gpu/gles2_conform_support/native/main.cc

Issue 474523003: Enable command line arguments for GLES2 CTS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased with arg change Created 6 years, 4 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 | « gpu/gles2_conform_support/gles2_conform_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/gles2_conform_support/native/main.cc
diff --git a/gpu/gles2_conform_support/native/main.cc b/gpu/gles2_conform_support/native/main.cc
index ea1cdf303ceee4d989f1198f3fa04816da4ac9b3..d0d05d86455180352a87801278c6eee65a692253 100644
--- a/gpu/gles2_conform_support/native/main.cc
+++ b/gpu/gles2_conform_support/native/main.cc
@@ -8,6 +8,9 @@
#if defined(OS_MACOSX)
#include "base/mac/scoped_nsautorelease_pool.h"
#endif
+#if defined(OS_WIN)
+#include "base/strings/utf_string_conversions.h"
+#endif
#include "ui/gl/gl_surface.h"
extern "C" {
@@ -23,10 +26,30 @@ int main(int argc, char *argv[]) {
CommandLine::Init(argc, argv);
base::MessageLoopForUI message_loop;
+ CommandLine::StringVector args =
+ CommandLine::ForCurrentProcess()->GetArgs();
+
#if defined(OS_MACOSX)
base::mac::ScopedNSAutoreleasePool pool;
#endif
- GTFMain(argc, argv);
+
+ scoped_ptr<const char*[]> argsArray(new const char*[args.size()+1]);
+ argsArray[0] = argv[0];
+
+#if defined(OS_WIN)
+ std::vector<std::string> argsNonWide(args.size());
+ for (size_t index = 0; index < args.size(); ++index) {
+ argsNonWide[index] = base::UTF16ToASCII(args[index]);
+ argsArray[index+1] = argsNonWide[index].c_str();
+ }
+#else
+ for (size_t index = 0; index < args.size(); ++index) {
+ argsArray[index+1] = args[index].c_str();
+ }
+#endif
+
+ GTFMain(static_cast<int>(args.size()+1),
+ const_cast<char**>(argsArray.get()));
return 0;
}
« no previous file with comments | « gpu/gles2_conform_support/gles2_conform_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698