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

Side by Side Diff: chrome/test/perf/rendering/throughput_tests.cc

Issue 18286004: Move PathExists to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « chrome/test/nacl/nacl_browsertest_util.cc ('k') | chrome/test/perf/shutdown_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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/file_util.h" 6 #include "base/file_util.h"
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 // Set path to test html. 264 // Set path to test html.
265 base::FilePath test_path; 265 base::FilePath test_path;
266 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_path)); 266 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_path));
267 test_path = test_path.Append(FILE_PATH_LITERAL("perf")); 267 test_path = test_path.Append(FILE_PATH_LITERAL("perf"));
268 if (flags & kInternal) 268 if (flags & kInternal)
269 test_path = test_path.Append(FILE_PATH_LITERAL("private")); 269 test_path = test_path.Append(FILE_PATH_LITERAL("private"));
270 test_path = test_path.Append(FILE_PATH_LITERAL("rendering")); 270 test_path = test_path.Append(FILE_PATH_LITERAL("rendering"));
271 test_path = test_path.Append(FILE_PATH_LITERAL("throughput")); 271 test_path = test_path.Append(FILE_PATH_LITERAL("throughput"));
272 test_path = test_path.AppendASCII(test_name); 272 test_path = test_path.AppendASCII(test_name);
273 test_path = test_path.Append(FILE_PATH_LITERAL("index.html")); 273 test_path = test_path.Append(FILE_PATH_LITERAL("index.html"));
274 ASSERT_TRUE(file_util::PathExists(test_path)) 274 ASSERT_TRUE(base::PathExists(test_path))
275 << "Missing test file: " << test_path.value(); 275 << "Missing test file: " << test_path.value();
276 276
277 gurl_ = net::FilePathToFileURL(test_path); 277 gurl_ = net::FilePathToFileURL(test_path);
278 RunTestWithURL(test_name, flags); 278 RunTestWithURL(test_name, flags);
279 } 279 }
280 280
281 // flags is one or more of RunTestFlags OR'd together. 281 // flags is one or more of RunTestFlags OR'd together.
282 void RunCanvasBenchTest(const std::string& test_name, int flags) { 282 void RunCanvasBenchTest(const std::string& test_name, int flags) {
283 // Set path to test html. 283 // Set path to test html.
284 base::FilePath test_path; 284 base::FilePath test_path;
285 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_path)); 285 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_path));
286 test_path = test_path.Append(FILE_PATH_LITERAL("perf")); 286 test_path = test_path.Append(FILE_PATH_LITERAL("perf"));
287 test_path = test_path.Append(FILE_PATH_LITERAL("canvas_bench")); 287 test_path = test_path.Append(FILE_PATH_LITERAL("canvas_bench"));
288 test_path = test_path.AppendASCII(test_name + ".html"); 288 test_path = test_path.AppendASCII(test_name + ".html");
289 ASSERT_TRUE(file_util::PathExists(test_path)) 289 ASSERT_TRUE(base::PathExists(test_path))
290 << "Missing test file: " << test_path.value(); 290 << "Missing test file: " << test_path.value();
291 291
292 gurl_ = net::FilePathToFileURL(test_path); 292 gurl_ = net::FilePathToFileURL(test_path);
293 RunTestWithURL(test_name, flags); 293 RunTestWithURL(test_name, flags);
294 } 294 }
295 295
296 // flags is one or more of RunTestFlags OR'd together. 296 // flags is one or more of RunTestFlags OR'd together.
297 void RunTestWithURL(int flags) { 297 void RunTestWithURL(int flags) {
298 RunTestWithURL(gurl_.possibly_invalid_spec(), flags); 298 RunTestWithURL(gurl_.possibly_invalid_spec(), flags);
299 } 299 }
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 594
595 IN_PROC_BROWSER_TEST_F(ThroughputTestGPU, CanvasManyImagesGPU) { 595 IN_PROC_BROWSER_TEST_F(ThroughputTestGPU, CanvasManyImagesGPU) {
596 RunCanvasBenchTest("many_images", kNone | kIsGpuCanvasTest); 596 RunCanvasBenchTest("many_images", kNone | kIsGpuCanvasTest);
597 } 597 }
598 598
599 IN_PROC_BROWSER_TEST_F(ThroughputTestThread, CanvasManyImagesGPU) { 599 IN_PROC_BROWSER_TEST_F(ThroughputTestThread, CanvasManyImagesGPU) {
600 RunCanvasBenchTest("many_images", kNone | kIsGpuCanvasTest); 600 RunCanvasBenchTest("many_images", kNone | kIsGpuCanvasTest);
601 } 601 }
602 602
603 } // namespace 603 } // namespace
OLDNEW
« no previous file with comments | « chrome/test/nacl/nacl_browsertest_util.cc ('k') | chrome/test/perf/shutdown_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698