OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
| 5 #include "app/app_switches.h" |
5 #include "base/command_line.h" | 6 #include "base/command_line.h" |
6 #include "base/environment.h" | 7 #include "base/environment.h" |
| 8 #include "base/logging.h" |
7 #include "base/path_service.h" | 9 #include "base/path_service.h" |
8 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
9 #include "chrome/common/chrome_paths.h" | 11 #include "chrome/common/chrome_paths.h" |
10 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
11 #include "chrome/test/test_launcher_utils.h" | 13 #include "chrome/test/test_launcher_utils.h" |
12 | 14 |
13 namespace test_launcher_utils { | 15 namespace test_launcher_utils { |
14 | 16 |
15 void PrepareBrowserCommandLineForTests(CommandLine* command_line) { | 17 void PrepareBrowserCommandLineForTests(CommandLine* command_line) { |
16 // Turn off tip loading for tests; see http://crbug.com/17725. | 18 // Turn off tip loading for tests; see http://crbug.com/17725. |
(...skipping 29 matching lines...) Expand all Loading... |
46 // | 48 // |
47 // Note: we use an environment variable here, because we have to pass the | 49 // Note: we use an environment variable here, because we have to pass the |
48 // value to the child process. This is the simplest way to do it. | 50 // value to the child process. This is the simplest way to do it. |
49 scoped_ptr<base::Environment> env(base::Environment::Create()); | 51 scoped_ptr<base::Environment> env(base::Environment::Create()); |
50 success = success && env->SetVar("XDG_CACHE_HOME", user_data_dir.value()); | 52 success = success && env->SetVar("XDG_CACHE_HOME", user_data_dir.value()); |
51 #endif | 53 #endif |
52 | 54 |
53 return success; | 55 return success; |
54 } | 56 } |
55 | 57 |
| 58 bool OverrideGLImplementation(CommandLine* command_line, |
| 59 const char* implementation_name) { |
| 60 if (command_line->HasSwitch(switches::kUseGL)) |
| 61 return false; |
| 62 |
| 63 command_line->AppendSwitchASCII(switches::kUseGL, implementation_name); |
| 64 |
| 65 return true; |
| 66 } |
| 67 |
56 } // namespace test_launcher_utils | 68 } // namespace test_launcher_utils |
OLD | NEW |