| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "base/command_line.h" | 4 #include "base/command_line.h" |
| 5 #include "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/test/test_timeouts.h" | 8 #include "base/test/test_timeouts.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 PrintResults(tab.get()); | 50 PrintResults(tab.get()); |
| 51 } | 51 } |
| 52 | 52 |
| 53 protected: | 53 protected: |
| 54 bool reference_; // True if this is a reference build. | 54 bool reference_; // True if this is a reference build. |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 bool WaitUntilTestCompletes(TabProxy* tab, const GURL& test_url) { | 57 bool WaitUntilTestCompletes(TabProxy* tab, const GURL& test_url) { |
| 58 return WaitUntilCookieValue(tab, test_url, "__done", | 58 return WaitUntilCookieValue(tab, test_url, "__done", |
| 59 TestTimeouts::large_test_timeout_ms(), "1"); | 59 TestTimeouts::large_test_timeout(), "1"); |
| 60 } | 60 } |
| 61 | 61 |
| 62 bool GetResults(TabProxy* tab, ResultsMap* results) { | 62 bool GetResults(TabProxy* tab, ResultsMap* results) { |
| 63 std::wstring json_wide; | 63 std::wstring json_wide; |
| 64 bool succeeded = tab->ExecuteAndExtractString(L"", | 64 bool succeeded = tab->ExecuteAndExtractString(L"", |
| 65 L"window.domAutomationController.send(" | 65 L"window.domAutomationController.send(" |
| 66 L" automation.getResults());", | 66 L" automation.getResults());", |
| 67 &json_wide); | 67 &json_wide); |
| 68 | 68 |
| 69 EXPECT_TRUE(succeeded); | 69 EXPECT_TRUE(succeeded); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 } | 114 } |
| 115 | 115 |
| 116 TEST_F(KrakenBenchmarkReferenceTest, Perf) { | 116 TEST_F(KrakenBenchmarkReferenceTest, Perf) { |
| 117 if (!CommandLine::ForCurrentProcess()->HasSwitch(kRunKraken)) | 117 if (!CommandLine::ForCurrentProcess()->HasSwitch(kRunKraken)) |
| 118 return; | 118 return; |
| 119 | 119 |
| 120 RunTest(); | 120 RunTest(); |
| 121 } | 121 } |
| 122 | 122 |
| 123 } // namespace | 123 } // namespace |
| OLD | NEW |