| 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/values.h" | 10 #include "base/values.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 show_window_ = true; | 33 show_window_ = true; |
| 34 } | 34 } |
| 35 | 35 |
| 36 void RunTest() { | 36 void RunTest() { |
| 37 FilePath::StringType start_file(kStartFile); | 37 FilePath::StringType start_file(kStartFile); |
| 38 FilePath test_path = GetV8BenchmarkDir(); | 38 FilePath test_path = GetV8BenchmarkDir(); |
| 39 test_path = test_path.Append(start_file); | 39 test_path = test_path.Append(start_file); |
| 40 GURL test_url(net::FilePathToFileURL(test_path)); | 40 GURL test_url(net::FilePathToFileURL(test_path)); |
| 41 | 41 |
| 42 scoped_refptr<TabProxy> tab(GetActiveTab()); | 42 scoped_refptr<TabProxy> tab(GetActiveTab()); |
| 43 ASSERT_TRUE(tab.get()); |
| 43 ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(test_url)); | 44 ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(test_url)); |
| 44 | 45 |
| 45 // Wait for the test to finish. | 46 // Wait for the test to finish. |
| 46 ASSERT_TRUE(WaitUntilTestCompletes(tab.get(), test_url)); | 47 ASSERT_TRUE(WaitUntilTestCompletes(tab.get(), test_url)); |
| 47 | 48 |
| 48 PrintResults(tab.get()); | 49 PrintResults(tab.get()); |
| 49 } | 50 } |
| 50 | 51 |
| 51 protected: | 52 protected: |
| 52 bool reference_; // True if this is a reference build. | 53 bool reference_; // True if this is a reference build. |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 } | 148 } |
| 148 | 149 |
| 149 TEST_F(V8BenchmarkReferenceTest, Perf) { | 150 TEST_F(V8BenchmarkReferenceTest, Perf) { |
| 150 if (!CommandLine::ForCurrentProcess()->HasSwitch(kRunV8Benchmark)) | 151 if (!CommandLine::ForCurrentProcess()->HasSwitch(kRunV8Benchmark)) |
| 151 return; | 152 return; |
| 152 | 153 |
| 153 RunTest(); | 154 RunTest(); |
| 154 } | 155 } |
| 155 | 156 |
| 156 } // namespace | 157 } // namespace |
| OLD | NEW |