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 "app/app_switches.h" |
6 #include "app/gfx/gl/gl_implementation.h" | 6 #include "app/gfx/gl/gl_implementation.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/environment.h" | 8 #include "base/environment.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
(...skipping 17 matching lines...) Expand all Loading... | |
28 // No default browser check, it would create an info-bar (if we are not the | 28 // No default browser check, it would create an info-bar (if we are not the |
29 // default browser) that could conflicts with some tests expectations. | 29 // default browser) that could conflicts with some tests expectations. |
30 command_line->AppendSwitch(switches::kNoDefaultBrowserCheck); | 30 command_line->AppendSwitch(switches::kNoDefaultBrowserCheck); |
31 | 31 |
32 // Enable warning level logging so that we can see when bad stuff happens. | 32 // Enable warning level logging so that we can see when bad stuff happens. |
33 command_line->AppendSwitch(switches::kEnableLogging); | 33 command_line->AppendSwitch(switches::kEnableLogging); |
34 command_line->AppendSwitchASCII(switches::kLoggingLevel, "1"); // warning | 34 command_line->AppendSwitchASCII(switches::kLoggingLevel, "1"); // warning |
35 | 35 |
36 // TODO(apatrick): Other pending changes will fix this for mac. | 36 // TODO(apatrick): Other pending changes will fix this for mac. |
37 #if !defined(OS_MACOSX) | 37 #if !defined(OS_MACOSX) |
38 // Force all tests to use OSMesa if they launch the GPU process. | 38 if (!command_line->HasSwitch(switches::kUseGL)) { |
apatrick_chromium
2010/11/15 22:10:23
This code is now deleted.
kkania
2010/11/15 23:09:16
Done.
| |
39 command_line->AppendSwitchASCII(switches::kUseGL, | 39 // Force all tests to use OSMesa if they launch the GPU process without |
40 gfx::kGLImplementationOSMesaName); | 40 // explicitly specifying a GL implementation. |
41 command_line->AppendSwitchASCII(switches::kUseGL, | |
42 gfx::kGLImplementationOSMesaName); | |
43 } | |
41 #endif | 44 #endif |
42 } | 45 } |
43 | 46 |
44 bool OverrideUserDataDir(const FilePath& user_data_dir) { | 47 bool OverrideUserDataDir(const FilePath& user_data_dir) { |
45 bool success = true; | 48 bool success = true; |
46 | 49 |
47 // PathService::Override() is the best way to change the user data directory. | 50 // PathService::Override() is the best way to change the user data directory. |
48 // This matches what is done in ChromeMain(). | 51 // This matches what is done in ChromeMain(). |
49 success = PathService::Override(chrome::DIR_USER_DATA, user_data_dir); | 52 success = PathService::Override(chrome::DIR_USER_DATA, user_data_dir); |
50 | 53 |
51 #if defined(OS_LINUX) | 54 #if defined(OS_LINUX) |
52 // Make sure the cache directory is inside our clear profile. Otherwise | 55 // Make sure the cache directory is inside our clear profile. Otherwise |
53 // the cache may contain data from earlier tests that could break the | 56 // the cache may contain data from earlier tests that could break the |
54 // current test. | 57 // current test. |
55 // | 58 // |
56 // Note: we use an environment variable here, because we have to pass the | 59 // Note: we use an environment variable here, because we have to pass the |
57 // value to the child process. This is the simplest way to do it. | 60 // value to the child process. This is the simplest way to do it. |
58 scoped_ptr<base::Environment> env(base::Environment::Create()); | 61 scoped_ptr<base::Environment> env(base::Environment::Create()); |
59 success = success && env->SetVar("XDG_CACHE_HOME", user_data_dir.value()); | 62 success = success && env->SetVar("XDG_CACHE_HOME", user_data_dir.value()); |
60 #endif | 63 #endif |
61 | 64 |
62 return success; | 65 return success; |
63 } | 66 } |
64 | 67 |
65 } // namespace test_launcher_utils | 68 } // namespace test_launcher_utils |
OLD | NEW |