| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/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/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "chrome/common/chrome_paths.h" | 12 #include "chrome/common/chrome_paths.h" |
| 13 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
| 14 #include "chrome/common/json_value_serializer.h" | 14 #include "chrome/common/json_value_serializer.h" |
| 15 #include "chrome/test/automation/tab_proxy.h" | 15 #include "chrome/test/automation/tab_proxy.h" |
| 16 #include "chrome/test/ui/javascript_test_util.h" | 16 #include "chrome/test/ui/javascript_test_util.h" |
| 17 #include "chrome/test/ui/ui_test.h" | 17 #include "chrome/test/ui/ui_perf_test.h" |
| 18 #include "googleurl/src/gurl.h" | 18 #include "googleurl/src/gurl.h" |
| 19 #include "net/base/net_util.h" | 19 #include "net/base/net_util.h" |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 static const FilePath::CharType kStartFile[] = | 23 static const FilePath::CharType kStartFile[] = |
| 24 FILE_PATH_LITERAL("run.html"); | 24 FILE_PATH_LITERAL("run.html"); |
| 25 | 25 |
| 26 const char kRunV8Benchmark[] = "run-v8-benchmark"; | 26 const char kRunV8Benchmark[] = "run-v8-benchmark"; |
| 27 | 27 |
| 28 class V8BenchmarkTest : public UITest { | 28 class V8BenchmarkTest : public UIPerfTest { |
| 29 public: | 29 public: |
| 30 typedef std::map<std::string, std::string> ResultsMap; | 30 typedef std::map<std::string, std::string> ResultsMap; |
| 31 | 31 |
| 32 V8BenchmarkTest() : reference_(false) { | 32 V8BenchmarkTest() : reference_(false) { |
| 33 dom_automation_enabled_ = true; | 33 dom_automation_enabled_ = true; |
| 34 show_window_ = true; | 34 show_window_ = true; |
| 35 } | 35 } |
| 36 | 36 |
| 37 void RunTest() { | 37 void RunTest() { |
| 38 FilePath::StringType start_file(kStartFile); | 38 FilePath::StringType start_file(kStartFile); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 } | 149 } |
| 150 | 150 |
| 151 TEST_F(V8BenchmarkReferenceTest, Perf) { | 151 TEST_F(V8BenchmarkReferenceTest, Perf) { |
| 152 if (!CommandLine::ForCurrentProcess()->HasSwitch(kRunV8Benchmark)) | 152 if (!CommandLine::ForCurrentProcess()->HasSwitch(kRunV8Benchmark)) |
| 153 return; | 153 return; |
| 154 | 154 |
| 155 RunTest(); | 155 RunTest(); |
| 156 } | 156 } |
| 157 | 157 |
| 158 } // namespace | 158 } // namespace |
| OLD | NEW |