| 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 15 matching lines...) Expand all Loading... |
| 26 command_line->AppendSwitch(switches::kNoFirstRun); | 26 command_line->AppendSwitch(switches::kNoFirstRun); |
| 27 | 27 |
| 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. | |
| 37 #if !defined(OS_MACOSX) | |
| 38 // Force all tests to use OSMesa if they launch the GPU process. | 36 // Force all tests to use OSMesa if they launch the GPU process. |
| 39 command_line->AppendSwitchASCII(switches::kUseGL, | 37 command_line->AppendSwitchASCII(switches::kUseGL, |
| 40 gfx::kGLImplementationOSMesaName); | 38 gfx::kGLImplementationOSMesaName); |
| 41 #endif | 39 |
| 40 // Mac does not support accelerated compositing with OSMesa. |
| 41 // http://crbug.com/58343 |
| 42 command_line->AppendSwitch(switches::kDisableAcceleratedCompositing); |
| 42 } | 43 } |
| 43 | 44 |
| 44 bool OverrideUserDataDir(const FilePath& user_data_dir) { | 45 bool OverrideUserDataDir(const FilePath& user_data_dir) { |
| 45 bool success = true; | 46 bool success = true; |
| 46 | 47 |
| 47 // PathService::Override() is the best way to change the user data directory. | 48 // PathService::Override() is the best way to change the user data directory. |
| 48 // This matches what is done in ChromeMain(). | 49 // This matches what is done in ChromeMain(). |
| 49 success = PathService::Override(chrome::DIR_USER_DATA, user_data_dir); | 50 success = PathService::Override(chrome::DIR_USER_DATA, user_data_dir); |
| 50 | 51 |
| 51 #if defined(OS_LINUX) | 52 #if defined(OS_LINUX) |
| 52 // Make sure the cache directory is inside our clear profile. Otherwise | 53 // Make sure the cache directory is inside our clear profile. Otherwise |
| 53 // the cache may contain data from earlier tests that could break the | 54 // the cache may contain data from earlier tests that could break the |
| 54 // current test. | 55 // current test. |
| 55 // | 56 // |
| 56 // Note: we use an environment variable here, because we have to pass the | 57 // 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. | 58 // value to the child process. This is the simplest way to do it. |
| 58 scoped_ptr<base::Environment> env(base::Environment::Create()); | 59 scoped_ptr<base::Environment> env(base::Environment::Create()); |
| 59 success = success && env->SetVar("XDG_CACHE_HOME", user_data_dir.value()); | 60 success = success && env->SetVar("XDG_CACHE_HOME", user_data_dir.value()); |
| 60 #endif | 61 #endif |
| 61 | 62 |
| 62 return success; | 63 return success; |
| 63 } | 64 } |
| 64 | 65 |
| 65 } // namespace test_launcher_utils | 66 } // namespace test_launcher_utils |
| OLD | NEW |