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

Side by Side Diff: chrome/test/page_cycler/page_cycler_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 | « chrome/test/memory_test/memory_test.cc ('k') | chrome/test/tab_switching/tab_switching_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/eintr_wrapper.h" 7 #include "base/eintr_wrapper.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 #endif 173 #endif
174 UITest::SetUp(); 174 UITest::SetUp();
175 } 175 }
176 176
177 // For HTTP tests, the name must be safe for use in a URL without escaping. 177 // For HTTP tests, the name must be safe for use in a URL without escaping.
178 void RunPageCycler(const char* name, std::wstring* pages, 178 void RunPageCycler(const char* name, std::wstring* pages,
179 std::string* timings, bool use_http) { 179 std::string* timings, bool use_http) {
180 180
181 // Make sure the test data is checked out 181 // Make sure the test data is checked out
182 FilePath test_path; 182 FilePath test_path;
183 PathService::Get(base::DIR_EXE, &test_path); 183 PathService::Get(base::DIR_SOURCE_ROOT, &test_path);
184 test_path = test_path.DirName();
185 test_path = test_path.DirName();
186 test_path = test_path.Append(FILE_PATH_LITERAL("data")); 184 test_path = test_path.Append(FILE_PATH_LITERAL("data"));
187 test_path = test_path.Append(FILE_PATH_LITERAL("page_cycler")); 185 test_path = test_path.Append(FILE_PATH_LITERAL("page_cycler"));
188 test_path = test_path.AppendASCII(name); 186 test_path = test_path.AppendASCII(name);
189 ASSERT_TRUE(file_util::PathExists(test_path)) << "Missing test data"; 187 ASSERT_TRUE(file_util::PathExists(test_path)) << "Missing test data";
190 188
191 #if defined(OS_MACOSX) 189 #if defined(OS_MACOSX)
192 PopulateUBC(test_path); 190 PopulateUBC(test_path);
193 #endif 191 #endif
194 192
195 GURL test_url; 193 GURL test_url;
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 518
521 TEST_F(PageCyclerTest, BloatHttp) { 519 TEST_F(PageCyclerTest, BloatHttp) {
522 RunTest("bloat", true); 520 RunTest("bloat", true);
523 } 521 }
524 522
525 TEST_F(PageCyclerReferenceTest, BloatHttp) { 523 TEST_F(PageCyclerReferenceTest, BloatHttp) {
526 RunTest("bloat", true); 524 RunTest("bloat", true);
527 } 525 }
528 526
529 } // namespace 527 } // namespace
OLDNEW
« no previous file with comments | « chrome/test/memory_test/memory_test.cc ('k') | chrome/test/tab_switching/tab_switching_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698