Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: chrome/test/ui/dom_checker_uitest.cc

Issue 149281: Sprinkle some defensiveness into the UI tests so that they don't explode if t... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/page_cycler/page_cycler_test.cc ('k') | chrome/test/ui/sunspider_uitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/test/page_cycler/page_cycler_test.cc ('k') | chrome/test/ui/sunspider_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698