| 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_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/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
| 11 #include "base/values.h" | 12 #include "base/values.h" |
| 12 #include "chrome/common/chrome_paths.h" | 13 #include "chrome/common/chrome_paths.h" |
| 13 #include "chrome/common/json_value_serializer.h" | 14 #include "chrome/common/json_value_serializer.h" |
| 14 #include "chrome/test/automation/tab_proxy.h" | 15 #include "chrome/test/automation/tab_proxy.h" |
| 15 #include "chrome/test/ui/javascript_test_util.h" | 16 #include "chrome/test/ui/javascript_test_util.h" |
| 16 #include "chrome/test/ui/ui_perf_test.h" | 17 #include "chrome/test/ui/ui_perf_test.h" |
| 17 #include "googleurl/src/gurl.h" | 18 #include "googleurl/src/gurl.h" |
| 18 #include "net/base/net_util.h" | 19 #include "net/base/net_util.h" |
| 19 | 20 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 private: | 54 private: |
| 54 // Return the path to the dromaeo benchmark directory on the local filesystem. | 55 // Return the path to the dromaeo benchmark directory on the local filesystem. |
| 55 FilePath GetDromaeoDir() { | 56 FilePath GetDromaeoDir() { |
| 56 FilePath test_dir; | 57 FilePath test_dir; |
| 57 PathService::Get(chrome::DIR_TEST_DATA, &test_dir); | 58 PathService::Get(chrome::DIR_TEST_DATA, &test_dir); |
| 58 return test_dir.AppendASCII("dromaeo"); | 59 return test_dir.AppendASCII("dromaeo"); |
| 59 } | 60 } |
| 60 | 61 |
| 61 bool WaitUntilTestCompletes(TabProxy* tab, const GURL& test_url) { | 62 bool WaitUntilTestCompletes(TabProxy* tab, const GURL& test_url) { |
| 62 return WaitUntilCookieValue(tab, test_url, "__done", | 63 return WaitUntilCookieValue(tab, test_url, "__done", |
| 63 UITest::test_timeout_ms(), "1"); | 64 TestTimeouts::huge_test_timeout_ms(), "1"); |
| 64 } | 65 } |
| 65 | 66 |
| 66 bool GetScore(TabProxy* tab, std::string* score) { | 67 bool GetScore(TabProxy* tab, std::string* score) { |
| 67 std::wstring score_wide; | 68 std::wstring score_wide; |
| 68 bool succeeded = tab->ExecuteAndExtractString(L"", | 69 bool succeeded = tab->ExecuteAndExtractString(L"", |
| 69 L"window.domAutomationController.send(automation.GetScore());", | 70 L"window.domAutomationController.send(automation.GetScore());", |
| 70 &score_wide); | 71 &score_wide); |
| 71 | 72 |
| 72 // Note that we don't use ASSERT_TRUE here (and in some other places) as it | 73 // 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. | 74 // doesn't work inside a function with a return type other than void. |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 168 |
| 168 TEST_F(DromaeoReferenceTest, JSLibPerf) { | 169 TEST_F(DromaeoReferenceTest, JSLibPerf) { |
| 169 if (!CommandLine::ForCurrentProcess()->HasSwitch(kRunDromaeo)) | 170 if (!CommandLine::ForCurrentProcess()->HasSwitch(kRunDromaeo)) |
| 170 return; | 171 return; |
| 171 | 172 |
| 172 RunTest(FILE_PATH_LITERAL("jslib")); | 173 RunTest(FILE_PATH_LITERAL("jslib")); |
| 173 } | 174 } |
| 174 | 175 |
| 175 | 176 |
| 176 } // namespace | 177 } // namespace |
| OLD | NEW |