| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/test/test_timeouts.h" | 9 #include "base/test/test_timeouts.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 private: | 55 private: |
| 56 // Return the path to the SunSpider directory on the local filesystem. | 56 // Return the path to the SunSpider directory on the local filesystem. |
| 57 FilePath GetSunSpiderDir() { | 57 FilePath GetSunSpiderDir() { |
| 58 FilePath test_dir; | 58 FilePath test_dir; |
| 59 PathService::Get(chrome::DIR_TEST_DATA, &test_dir); | 59 PathService::Get(chrome::DIR_TEST_DATA, &test_dir); |
| 60 return test_dir.AppendASCII("sunspider"); | 60 return test_dir.AppendASCII("sunspider"); |
| 61 } | 61 } |
| 62 | 62 |
| 63 bool WaitUntilTestCompletes(TabProxy* tab, const GURL& test_url) { | 63 bool WaitUntilTestCompletes(TabProxy* tab, const GURL& test_url) { |
| 64 return WaitUntilCookieValue(tab, test_url, "__done", | 64 return WaitUntilCookieValue(tab, test_url, "__done", |
| 65 TestTimeouts::huge_test_timeout_ms(), "1"); | 65 TestTimeouts::large_test_timeout_ms(), "1"); |
| 66 } | 66 } |
| 67 | 67 |
| 68 bool GetTotal(TabProxy* tab, std::string* total) { | 68 bool GetTotal(TabProxy* tab, std::string* total) { |
| 69 std::wstring total_wide; | 69 std::wstring total_wide; |
| 70 bool succeeded = tab->ExecuteAndExtractString(L"", | 70 bool succeeded = tab->ExecuteAndExtractString(L"", |
| 71 L"window.domAutomationController.send(automation.GetTotal());", | 71 L"window.domAutomationController.send(automation.GetTotal());", |
| 72 &total_wide); | 72 &total_wide); |
| 73 | 73 |
| 74 // Note that we don't use ASSERT_TRUE here (and in some other places) as it | 74 // Note that we don't use ASSERT_TRUE here (and in some other places) as it |
| 75 // doesn't work inside a function with a return type other than void. | 75 // doesn't work inside a function with a return type other than void. |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 } | 135 } |
| 136 | 136 |
| 137 TEST_F(SunSpiderReferenceTest, Perf) { | 137 TEST_F(SunSpiderReferenceTest, Perf) { |
| 138 if (!CommandLine::ForCurrentProcess()->HasSwitch(kRunSunSpider)) | 138 if (!CommandLine::ForCurrentProcess()->HasSwitch(kRunSunSpider)) |
| 139 return; | 139 return; |
| 140 | 140 |
| 141 RunTest(); | 141 RunTest(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 } // namespace | 144 } // namespace |
| OLD | NEW |