OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 url_string.append(test_directory); | 193 url_string.append(test_directory); |
194 url_string.append(start_file); | 194 url_string.append(start_file); |
195 test_url = GURL(url_string); | 195 test_url = GURL(url_string); |
196 } else { | 196 } else { |
197 FilePath test_path = GetDomCheckerDir(); | 197 FilePath test_path = GetDomCheckerDir(); |
198 test_path = test_path.Append(start_file); | 198 test_path = test_path.Append(start_file); |
199 test_url = net::FilePathToFileURL(test_path); | 199 test_url = net::FilePathToFileURL(test_path); |
200 } | 200 } |
201 | 201 |
202 scoped_refptr<TabProxy> tab(GetActiveTab()); | 202 scoped_refptr<TabProxy> tab(GetActiveTab()); |
| 203 ASSERT_TRUE(tab.get()); |
203 tab->NavigateToURL(test_url); | 204 tab->NavigateToURL(test_url); |
204 | 205 |
205 // Wait for the test to finish. | 206 // Wait for the test to finish. |
206 ASSERT_TRUE(WaitUntilTestCompletes(tab.get())); | 207 ASSERT_TRUE(WaitUntilTestCompletes(tab.get())); |
207 | 208 |
208 // Get the test results. | 209 // Get the test results. |
209 ASSERT_TRUE(GetTestCount(tab.get(), test_count)); | 210 ASSERT_TRUE(GetTestCount(tab.get(), test_count)); |
210 ASSERT_TRUE(GetTestsFailed(tab.get(), tests_failed)); | 211 ASSERT_TRUE(GetTestsFailed(tab.get(), tests_failed)); |
211 ASSERT_GT(*test_count, 0); | 212 ASSERT_GT(*test_count, 0); |
212 } | 213 } |
(...skipping 13 matching lines...) Expand all Loading... |
226 TEST_F(DomCheckerTest, Http) { | 227 TEST_F(DomCheckerTest, Http) { |
227 if (!CommandLine::ForCurrentProcess()->HasSwitch(kRunDomCheckerTest)) | 228 if (!CommandLine::ForCurrentProcess()->HasSwitch(kRunDomCheckerTest)) |
228 return; | 229 return; |
229 | 230 |
230 ResultsList new_passes, new_failures; | 231 ResultsList new_passes, new_failures; |
231 RunTest(true, &new_passes, &new_failures); | 232 RunTest(true, &new_passes, &new_failures); |
232 PrintResults(new_passes, new_failures); | 233 PrintResults(new_passes, new_failures); |
233 } | 234 } |
234 | 235 |
235 } // namespace | 236 } // namespace |
OLD | NEW |