| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |