| 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_path.h" | 6 #include "base/file_path.h" |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 bool IsGpuAvailable() const { | 62 bool IsGpuAvailable() const { |
| 63 return CommandLine::ForCurrentProcess()->HasSwitch("enable-gpu"); | 63 return CommandLine::ForCurrentProcess()->HasSwitch("enable-gpu"); |
| 64 } | 64 } |
| 65 | 65 |
| 66 // Parse flags from JSON to control the test behavior. | 66 // Parse flags from JSON to control the test behavior. |
| 67 bool ParseFlagsFromJSON(const FilePath& json_dir, | 67 bool ParseFlagsFromJSON(const FilePath& json_dir, |
| 68 const std::string& json, | 68 const std::string& json, |
| 69 int index) { | 69 int index) { |
| 70 scoped_ptr<base::Value> root; | 70 scoped_ptr<base::Value> root; |
| 71 root.reset(base::JSONReader::Read(json, false)); | 71 root.reset(base::JSONReader::Read(json)); |
| 72 | 72 |
| 73 ListValue* root_list = NULL; | 73 ListValue* root_list = NULL; |
| 74 if (!root.get() || !root->GetAsList(&root_list)) { | 74 if (!root.get() || !root->GetAsList(&root_list)) { |
| 75 LOG(ERROR) << "JSON missing root list element"; | 75 LOG(ERROR) << "JSON missing root list element"; |
| 76 return false; | 76 return false; |
| 77 } | 77 } |
| 78 | 78 |
| 79 DictionaryValue* item = NULL; | 79 DictionaryValue* item = NULL; |
| 80 if (!root_list->GetDictionary(index, &item)) { | 80 if (!root_list->GetDictionary(index, &item)) { |
| 81 LOG(ERROR) << "index " << index << " not found in JSON"; | 81 LOG(ERROR) << "index " << index << " not found in JSON"; |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 | 517 |
| 518 IN_PROC_BROWSER_TEST_F(ThroughputTestSW, CanvasManyImagesSW) { | 518 IN_PROC_BROWSER_TEST_F(ThroughputTestSW, CanvasManyImagesSW) { |
| 519 RunCanvasBenchTest("many_images", kNone); | 519 RunCanvasBenchTest("many_images", kNone); |
| 520 } | 520 } |
| 521 | 521 |
| 522 IN_PROC_BROWSER_TEST_F(ThroughputTestGPU, CanvasManyImagesGPU) { | 522 IN_PROC_BROWSER_TEST_F(ThroughputTestGPU, CanvasManyImagesGPU) { |
| 523 RunCanvasBenchTest("many_images", kNone); | 523 RunCanvasBenchTest("many_images", kNone); |
| 524 } | 524 } |
| 525 | 525 |
| 526 } // namespace | 526 } // namespace |
| OLD | NEW |