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_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/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 private: | 53 private: |
54 // Return the path to the dromaeo benchmark directory on the local filesystem. | 54 // Return the path to the dromaeo benchmark directory on the local filesystem. |
55 FilePath GetDromaeoDir() { | 55 FilePath GetDromaeoDir() { |
56 FilePath test_dir; | 56 FilePath test_dir; |
57 PathService::Get(chrome::DIR_TEST_DATA, &test_dir); | 57 PathService::Get(chrome::DIR_TEST_DATA, &test_dir); |
58 return test_dir.AppendASCII("dromaeo"); | 58 return test_dir.AppendASCII("dromaeo"); |
59 } | 59 } |
60 | 60 |
61 bool WaitUntilTestCompletes(TabProxy* tab, const GURL& test_url) { | 61 bool WaitUntilTestCompletes(TabProxy* tab, const GURL& test_url) { |
62 return WaitUntilCookieValue(tab, test_url, "__done", | 62 return WaitUntilCookieValue(tab, test_url, "__done", |
63 TestTimeouts::huge_test_timeout_ms(), "1"); | 63 TestTimeouts::large_test_timeout_ms(), "1"); |
64 } | 64 } |
65 | 65 |
66 bool GetScore(TabProxy* tab, std::string* score) { | 66 bool GetScore(TabProxy* tab, std::string* score) { |
67 std::wstring score_wide; | 67 std::wstring score_wide; |
68 bool succeeded = tab->ExecuteAndExtractString(L"", | 68 bool succeeded = tab->ExecuteAndExtractString(L"", |
69 L"window.domAutomationController.send(automation.GetScore());", | 69 L"window.domAutomationController.send(automation.GetScore());", |
70 &score_wide); | 70 &score_wide); |
71 | 71 |
72 // Note that we don't use ASSERT_TRUE here (and in some other places) as it | 72 // Note that we don't use ASSERT_TRUE here (and in some other places) as it |
73 // doesn't work inside a function with a return type other than void. | 73 // doesn't work inside a function with a return type other than void. |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 TEST_F(DromaeoReferenceTest, JSLibPerf) { | 156 TEST_F(DromaeoReferenceTest, JSLibPerf) { |
157 if (!CommandLine::ForCurrentProcess()->HasSwitch(kRunDromaeo)) | 157 if (!CommandLine::ForCurrentProcess()->HasSwitch(kRunDromaeo)) |
158 return; | 158 return; |
159 | 159 |
160 RunTest("jslib"); | 160 RunTest("jslib"); |
161 } | 161 } |
162 | 162 |
163 | 163 |
164 } // namespace | 164 } // namespace |
OLD | NEW |