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

Side by Side Diff: webkit/tools/test_shell/test_shell_main.cc

Issue 375016: Use GetSwitchValuePath. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 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
« no previous file with comments | « webkit/tools/test_shell/node_leak_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/at_exit.h" 5 #include "base/at_exit.h"
6 #include "base/basictypes.h" 6 #include "base/basictypes.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/event_recorder.h" 8 #include "base/event_recorder.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 if (playback_mode) 129 if (playback_mode)
130 cache_mode = net::HttpCache::PLAYBACK; 130 cache_mode = net::HttpCache::PLAYBACK;
131 else if (record_mode) 131 else if (record_mode)
132 cache_mode = net::HttpCache::RECORD; 132 cache_mode = net::HttpCache::RECORD;
133 133
134 if (layout_test_mode || 134 if (layout_test_mode ||
135 parsed_command_line.HasSwitch(test_shell::kEnableFileCookies)) 135 parsed_command_line.HasSwitch(test_shell::kEnableFileCookies))
136 net::CookieMonster::EnableFileScheme(); 136 net::CookieMonster::EnableFileScheme();
137 137
138 FilePath cache_path = FilePath::FromWStringHack( 138 FilePath cache_path =
139 parsed_command_line.GetSwitchValue(test_shell::kCacheDir)); 139 parsed_command_line.GetSwitchValuePath(test_shell::kCacheDir);
140 // If the cache_path is empty and it's layout_test_mode, leave it empty 140 // If the cache_path is empty and it's layout_test_mode, leave it empty
141 // so we use an in-memory cache. This makes running multiple test_shells 141 // so we use an in-memory cache. This makes running multiple test_shells
142 // in parallel less flaky. 142 // in parallel less flaky.
143 if (cache_path.empty() && !layout_test_mode) { 143 if (cache_path.empty() && !layout_test_mode) {
144 PathService::Get(base::DIR_EXE, &cache_path); 144 PathService::Get(base::DIR_EXE, &cache_path);
145 cache_path = cache_path.AppendASCII("cache"); 145 cache_path = cache_path.AppendASCII("cache");
146 } 146 }
147 147
148 // Initializing with a default context, which means no on-disk cookie DB, 148 // Initializing with a default context, which means no on-disk cookie DB,
149 // and no support for directory listings. 149 // and no support for directory listings.
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 366
367 TestShell::ShutdownTestShell(); 367 TestShell::ShutdownTestShell();
368 TestShell::CleanupLogging(); 368 TestShell::CleanupLogging();
369 369
370 // Tear down shared StatsTable; prevents unit_tests from leaking it. 370 // Tear down shared StatsTable; prevents unit_tests from leaking it.
371 StatsTable::set_current(NULL); 371 StatsTable::set_current(NULL);
372 delete table; 372 delete table;
373 373
374 return 0; 374 return 0;
375 } 375 }
OLDNEW
« no previous file with comments | « webkit/tools/test_shell/node_leak_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698