Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(854)

Side by Side Diff: chrome/test/test_launcher_utils.cc

Issue 4724004: Group commandline settings in UI test and in process browser test. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 22 matching lines...) Expand all
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 // 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.
37 command_line->AppendSwitchASCII(switches::kUseGL, 37 command_line->AppendSwitchASCII(switches::kUseGL,
38 gfx::kGLImplementationOSMesaName); 38 gfx::kGLImplementationOSMesaName);
39 39
40 // Mac does not support accelerated compositing with OSMesa. 40 // Mac does not support accelerated compositing with OSMesa.
41 // http://crbug.com/58343 41 // http://crbug.com/58343
42 command_line->AppendSwitch(switches::kDisableAcceleratedCompositing); 42 command_line->AppendSwitch(switches::kDisableAcceleratedCompositing);
43
44 // Disable safebrowsing autoupdate. It is not needed for UI test.
45 command_line.AppendSwitch(switches::kSbDisableAutoUpdate);
Scott Hess - ex-Googler 2010/11/10 18:27:05 Surrounding code uses ->.
43 } 46 }
44 47
45 bool OverrideUserDataDir(const FilePath& user_data_dir) { 48 bool OverrideUserDataDir(const FilePath& user_data_dir) {
46 bool success = true; 49 bool success = true;
47 50
48 // PathService::Override() is the best way to change the user data directory. 51 // PathService::Override() is the best way to change the user data directory.
49 // This matches what is done in ChromeMain(). 52 // This matches what is done in ChromeMain().
50 success = PathService::Override(chrome::DIR_USER_DATA, user_data_dir); 53 success = PathService::Override(chrome::DIR_USER_DATA, user_data_dir);
51 54
52 #if defined(OS_LINUX) 55 #if defined(OS_LINUX)
53 // Make sure the cache directory is inside our clear profile. Otherwise 56 // Make sure the cache directory is inside our clear profile. Otherwise
54 // the cache may contain data from earlier tests that could break the 57 // the cache may contain data from earlier tests that could break the
55 // current test. 58 // current test.
56 // 59 //
57 // Note: we use an environment variable here, because we have to pass the 60 // Note: we use an environment variable here, because we have to pass the
58 // value to the child process. This is the simplest way to do it. 61 // value to the child process. This is the simplest way to do it.
59 scoped_ptr<base::Environment> env(base::Environment::Create()); 62 scoped_ptr<base::Environment> env(base::Environment::Create());
60 success = success && env->SetVar("XDG_CACHE_HOME", user_data_dir.value()); 63 success = success && env->SetVar("XDG_CACHE_HOME", user_data_dir.value());
61 #endif 64 #endif
62 65
63 return success; 66 return success;
64 } 67 }
65 68
66 } // namespace test_launcher_utils 69 } // namespace test_launcher_utils
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698