Index: content/public/test/test_launcher_utils.cc |
diff --git a/content/public/test/test_launcher_utils.cc b/content/public/test/test_launcher_utils.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8b4457a3b473727ab489c0bef63d3368be7871d6 |
--- /dev/null |
+++ b/content/public/test/test_launcher_utils.cc |
@@ -0,0 +1,38 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "content/public/test/test_launcher_utils.h" |
+ |
+#include "base/command_line.h" |
+#include "base/environment.h" |
+#include "base/logging.h" |
+#include "base/memory/scoped_ptr.h" |
+#include "base/path_service.h" |
+#include "base/string_number_conversions.h" |
+#include "content/public/common/content_switches.h" |
+#include "ui/gl/gl_switches.h" |
+ |
+namespace content { |
+ |
+void PrepareBrowserCommandLineForTests(CommandLine* command_line) { |
+ // Enable warning level logging so that we can see when bad stuff happens. |
+ command_line->AppendSwitch(switches::kEnableLogging); |
+ command_line->AppendSwitchASCII(switches::kLoggingLevel, "1"); // warning |
+ |
+ // Don't collect GPU info, load GPU blacklist, or schedule a GPU blacklist |
+ // auto-update. |
+ command_line->AppendSwitch(switches::kSkipGpuDataLoading); |
+} |
+ |
+bool OverrideGLImplementation(CommandLine* command_line, |
+ const std::string& implementation_name) { |
+ if (command_line->HasSwitch(switches::kUseGL)) |
+ return false; |
+ |
+ command_line->AppendSwitchASCII(switches::kUseGL, implementation_name); |
+ |
+ return true; |
+} |
+ |
+} // namespace test_launcher_utils |