| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/environment.h" | 6 #include "base/environment.h" |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 #endif | 60 #endif |
| 61 } | 61 } |
| 62 | 62 |
| 63 bool OverrideUserDataDir(const FilePath& user_data_dir) { | 63 bool OverrideUserDataDir(const FilePath& user_data_dir) { |
| 64 bool success = true; | 64 bool success = true; |
| 65 | 65 |
| 66 // PathService::Override() is the best way to change the user data directory. | 66 // PathService::Override() is the best way to change the user data directory. |
| 67 // This matches what is done in ChromeMain(). | 67 // This matches what is done in ChromeMain(). |
| 68 success = PathService::Override(chrome::DIR_USER_DATA, user_data_dir); | 68 success = PathService::Override(chrome::DIR_USER_DATA, user_data_dir); |
| 69 | 69 |
| 70 #if defined(OS_LINUX) | 70 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 71 // Make sure the cache directory is inside our clear profile. Otherwise | 71 // Make sure the cache directory is inside our clear profile. Otherwise |
| 72 // the cache may contain data from earlier tests that could break the | 72 // the cache may contain data from earlier tests that could break the |
| 73 // current test. | 73 // current test. |
| 74 // | 74 // |
| 75 // Note: we use an environment variable here, because we have to pass the | 75 // Note: we use an environment variable here, because we have to pass the |
| 76 // value to the child process. This is the simplest way to do it. | 76 // value to the child process. This is the simplest way to do it. |
| 77 scoped_ptr<base::Environment> env(base::Environment::Create()); | 77 scoped_ptr<base::Environment> env(base::Environment::Create()); |
| 78 success = success && env->SetVar("XDG_CACHE_HOME", user_data_dir.value()); | 78 success = success && env->SetVar("XDG_CACHE_HOME", user_data_dir.value()); |
| 79 #endif | 79 #endif |
| 80 | 80 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 110 // Make it possible for selected tests to request a longer timeout. | 110 // Make it possible for selected tests to request a longer timeout. |
| 111 // Generally tests should really avoid doing too much, and splitting | 111 // Generally tests should really avoid doing too much, and splitting |
| 112 // a test instead of using SLOW prefix is strongly preferred. | 112 // a test instead of using SLOW prefix is strongly preferred. |
| 113 if (test_name.find("SLOW_") != std::string::npos) | 113 if (test_name.find("SLOW_") != std::string::npos) |
| 114 timeout_ms *= kSlowTestTimeoutMultiplier; | 114 timeout_ms *= kSlowTestTimeoutMultiplier; |
| 115 | 115 |
| 116 return timeout_ms; | 116 return timeout_ms; |
| 117 } | 117 } |
| 118 | 118 |
| 119 } // namespace test_launcher_utils | 119 } // namespace test_launcher_utils |
| OLD | NEW |