OLD | NEW |
1 // Copyright (c) 2009 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/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
10 #include "base/values.h" | 11 #include "base/values.h" |
11 #include "chrome/common/chrome_paths.h" | 12 #include "chrome/common/chrome_paths.h" |
12 #include "chrome/common/json_value_serializer.h" | 13 #include "chrome/common/json_value_serializer.h" |
13 #include "chrome/test/automation/tab_proxy.h" | 14 #include "chrome/test/automation/tab_proxy.h" |
14 #include "chrome/test/ui/javascript_test_util.h" | 15 #include "chrome/test/ui/javascript_test_util.h" |
15 #include "chrome/test/ui/ui_perf_test.h" | 16 #include "chrome/test/ui/ui_perf_test.h" |
16 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
17 #include "net/base/net_util.h" | 18 #include "net/base/net_util.h" |
18 | 19 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 private: | 55 private: |
55 // Return the path to the SunSpider directory on the local filesystem. | 56 // Return the path to the SunSpider directory on the local filesystem. |
56 FilePath GetSunSpiderDir() { | 57 FilePath GetSunSpiderDir() { |
57 FilePath test_dir; | 58 FilePath test_dir; |
58 PathService::Get(chrome::DIR_TEST_DATA, &test_dir); | 59 PathService::Get(chrome::DIR_TEST_DATA, &test_dir); |
59 return test_dir.AppendASCII("sunspider"); | 60 return test_dir.AppendASCII("sunspider"); |
60 } | 61 } |
61 | 62 |
62 bool WaitUntilTestCompletes(TabProxy* tab, const GURL& test_url) { | 63 bool WaitUntilTestCompletes(TabProxy* tab, const GURL& test_url) { |
63 return WaitUntilCookieValue(tab, test_url, "__done", | 64 return WaitUntilCookieValue(tab, test_url, "__done", |
64 UITest::test_timeout_ms(), "1"); | 65 TestTimeouts::huge_test_timeout_ms(), "1"); |
65 } | 66 } |
66 | 67 |
67 bool GetTotal(TabProxy* tab, std::string* total) { | 68 bool GetTotal(TabProxy* tab, std::string* total) { |
68 std::wstring total_wide; | 69 std::wstring total_wide; |
69 bool succeeded = tab->ExecuteAndExtractString(L"", | 70 bool succeeded = tab->ExecuteAndExtractString(L"", |
70 L"window.domAutomationController.send(automation.GetTotal());", | 71 L"window.domAutomationController.send(automation.GetTotal());", |
71 &total_wide); | 72 &total_wide); |
72 | 73 |
73 // 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 |
74 // 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 } | 147 } |
147 | 148 |
148 TEST_F(SunSpiderReferenceTest, Perf) { | 149 TEST_F(SunSpiderReferenceTest, Perf) { |
149 if (!CommandLine::ForCurrentProcess()->HasSwitch(kRunSunSpider)) | 150 if (!CommandLine::ForCurrentProcess()->HasSwitch(kRunSunSpider)) |
150 return; | 151 return; |
151 | 152 |
152 RunTest(); | 153 RunTest(); |
153 } | 154 } |
154 | 155 |
155 } // namespace | 156 } // namespace |
OLD | NEW |