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

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

Issue 192064: Hack to make tests work if out is a symlink: see if the current dir is the source root. (Closed)
Patch Set: use path.DirName().DirName() Created 11 years, 3 months 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
« no previous file with comments | « base/base_paths_linux.cc ('k') | chrome/test/page_cycler/page_cycler_test.cc » ('j') | 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-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/process_util.h" 10 #include "base/process_util.h"
(...skipping 30 matching lines...) Expand all
41 // Use the playback cache, but don't use playback events. 41 // Use the playback cache, but don't use playback events.
42 launch_arguments_.AppendSwitch(switches::kPlaybackMode); 42 launch_arguments_.AppendSwitch(switches::kPlaybackMode);
43 launch_arguments_.AppendSwitch(switches::kNoEvents); 43 launch_arguments_.AppendSwitch(switches::kNoEvents);
44 44
45 // Get the specified user data dir (optional) 45 // Get the specified user data dir (optional)
46 FilePath profile_dir = FilePath::FromWStringHack( 46 FilePath profile_dir = FilePath::FromWStringHack(
47 CommandLine::ForCurrentProcess()->GetSwitchValue(switches::kUserDataDir)); 47 CommandLine::ForCurrentProcess()->GetSwitchValue(switches::kUserDataDir));
48 48
49 if (profile_dir.empty()) { 49 if (profile_dir.empty()) {
50 // Compute the user-data-dir which contains our test cache. 50 // Compute the user-data-dir which contains our test cache.
51 PathService::Get(base::DIR_EXE, &profile_dir); 51 PathService::Get(base::DIR_SOURCE_ROOT, &profile_dir);
52 profile_dir = profile_dir.DirName();
53 profile_dir = profile_dir.DirName();
54 profile_dir = profile_dir.AppendASCII("data"); 52 profile_dir = profile_dir.AppendASCII("data");
55 profile_dir = profile_dir.AppendASCII("memory_test"); 53 profile_dir = profile_dir.AppendASCII("memory_test");
56 profile_dir = profile_dir.AppendASCII("general_mix"); 54 profile_dir = profile_dir.AppendASCII("general_mix");
57 55
58 if (!SetupTempDirectory(profile_dir)) { 56 if (!SetupTempDirectory(profile_dir)) {
59 // There isn't really a way to fail gracefully here. 57 // There isn't really a way to fail gracefully here.
60 // Neither this constuctor nor the SetUp() method return 58 // Neither this constuctor nor the SetUp() method return
61 // status to the caller. So, just fall through using the 59 // status to the caller. So, just fall through using the
62 // default profile and log this. The failure will be 60 // default profile and log this. The failure will be
63 // obvious. 61 // obvious.
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 428
431 TEST_F(MemoryTest, FiveTabTest) { 429 TEST_F(MemoryTest, FiveTabTest) {
432 RunTest("5t", 5); 430 RunTest("5t", 5);
433 } 431 }
434 432
435 TEST_F(MemoryTest, TwelveTabTest) { 433 TEST_F(MemoryTest, TwelveTabTest) {
436 RunTest("12t", 12); 434 RunTest("12t", 12);
437 } 435 }
438 436
439 } // namespace 437 } // namespace
OLDNEW
« no previous file with comments | « base/base_paths_linux.cc ('k') | chrome/test/page_cycler/page_cycler_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698