| OLD | NEW |
| 1 // Copyright (c) 2010 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/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 10 #include "base/string_split.h" | 10 #include "base/string_split.h" |
| 11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
| 12 #include "base/test/test_timeouts.h" |
| 12 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 13 #include "base/values.h" | 14 #include "base/values.h" |
| 14 #include "chrome/common/chrome_paths.h" | 15 #include "chrome/common/chrome_paths.h" |
| 15 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
| 16 #include "chrome/common/json_value_serializer.h" | 17 #include "chrome/common/json_value_serializer.h" |
| 17 #include "chrome/test/automation/tab_proxy.h" | 18 #include "chrome/test/automation/tab_proxy.h" |
| 18 #include "chrome/test/ui/ui_test.h" | 19 #include "chrome/test/ui/ui_test.h" |
| 19 #include "googleurl/src/gurl.h" | 20 #include "googleurl/src/gurl.h" |
| 20 #include "net/base/net_util.h" | 21 #include "net/base/net_util.h" |
| 21 | 22 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 &expected_failures_text); | 138 &expected_failures_text); |
| 138 if (!have_expected_results) | 139 if (!have_expected_results) |
| 139 return false; | 140 return false; |
| 140 ParseExpectedFailures(expected_failures_text, expected_failures); | 141 ParseExpectedFailures(expected_failures_text, expected_failures); |
| 141 return true; | 142 return true; |
| 142 } | 143 } |
| 143 | 144 |
| 144 bool WaitUntilTestCompletes(TabProxy* tab) { | 145 bool WaitUntilTestCompletes(TabProxy* tab) { |
| 145 return WaitUntilJavaScriptCondition(tab, L"", | 146 return WaitUntilJavaScriptCondition(tab, L"", |
| 146 L"window.domAutomationController.send(automation.IsDone());", | 147 L"window.domAutomationController.send(automation.IsDone());", |
| 147 UITest::test_timeout_ms()); | 148 TestTimeouts::huge_test_timeout_ms()); |
| 148 } | 149 } |
| 149 | 150 |
| 150 bool GetTestCount(TabProxy* tab, int* test_count) { | 151 bool GetTestCount(TabProxy* tab, int* test_count) { |
| 151 return tab->ExecuteAndExtractInt(L"", | 152 return tab->ExecuteAndExtractInt(L"", |
| 152 L"window.domAutomationController.send(automation.GetTestCount());", | 153 L"window.domAutomationController.send(automation.GetTestCount());", |
| 153 test_count); | 154 test_count); |
| 154 } | 155 } |
| 155 | 156 |
| 156 bool GetTestsFailed(TabProxy* tab, ResultsSet* tests_failed) { | 157 bool GetTestsFailed(TabProxy* tab, ResultsSet* tests_failed) { |
| 157 std::wstring json_wide; | 158 std::wstring json_wide; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 TEST_F(DomCheckerTest, FAILS_Http) { | 245 TEST_F(DomCheckerTest, FAILS_Http) { |
| 245 if (!CommandLine::ForCurrentProcess()->HasSwitch(kRunDomCheckerTest)) | 246 if (!CommandLine::ForCurrentProcess()->HasSwitch(kRunDomCheckerTest)) |
| 246 return; | 247 return; |
| 247 | 248 |
| 248 ResultsList new_passes, new_failures; | 249 ResultsList new_passes, new_failures; |
| 249 RunTest(true, &new_passes, &new_failures); | 250 RunTest(true, &new_passes, &new_failures); |
| 250 PrintResults(new_passes, new_failures); | 251 PrintResults(new_passes, new_failures); |
| 251 } | 252 } |
| 252 | 253 |
| 253 } // namespace | 254 } // namespace |
| OLD | NEW |