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

Side by Side Diff: chrome/browser/errorpage_uitest.cc

Issue 174015: Add automation call to wait for multiple navigations. (Closed)
Patch Set: backwards compatibility, properly done Created 11 years, 4 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
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/string_util.h" 5 #include "base/string_util.h"
6 #include "chrome/test/automation/tab_proxy.h" 6 #include "chrome/test/automation/tab_proxy.h"
7 #include "chrome/test/ui/ui_test.h" 7 #include "chrome/test/ui/ui_test.h"
8 #include "chrome/browser/net/url_request_failed_dns_job.h" 8 #include "chrome/browser/net/url_request_failed_dns_job.h"
9 #include "chrome/browser/net/url_request_mock_http_job.h" 9 #include "chrome/browser/net/url_request_mock_http_job.h"
10 #include "net/url_request/url_request_unittest.h" 10 #include "net/url_request/url_request_unittest.h"
(...skipping 12 matching lines...) Expand all
23 for (int i = 0; i < 100; ++i) { 23 for (int i = 0; i < 100; ++i) {
24 std::wstring title = GetActiveTabTitle(); 24 std::wstring title = GetActiveTabTitle();
25 if (title.find(UTF8ToWide(title_substring)) != std::wstring::npos) 25 if (title.find(UTF8ToWide(title_substring)) != std::wstring::npos)
26 return true; 26 return true;
27 PlatformThread::Sleep(sleep_timeout_ms() / 10); 27 PlatformThread::Sleep(sleep_timeout_ms() / 10);
28 } 28 }
29 return false; 29 return false;
30 } 30 }
31 }; 31 };
32 32
33 // Flaky, see http://crbug.com/19361 and http://crbug.com/19395. 33 TEST_F(ErrorPageTest, DNSError_Basic) {
34 TEST_F(ErrorPageTest, DISABLED_DNSError_Basic) {
35 GURL test_url(URLRequestFailedDnsJob::kTestUrl); 34 GURL test_url(URLRequestFailedDnsJob::kTestUrl);
36 35
37 NavigateToURL(test_url); 36 NavigateToURLBlockUntilNavigationsComplete(test_url, 2);
38 37
39 EXPECT_TRUE(WaitForTitleContaining(test_url.host())); 38 EXPECT_TRUE(WaitForTitleContaining(test_url.host()));
40 } 39 }
41 40
42 // Flaky, see http://crbug.com/19361 and http://crbug.com/19395. 41 // Flaky, see http://crbug.com/19361 and http://crbug.com/19395.
43 TEST_F(ErrorPageTest, DISABLED_DNSError_GoBack1) { 42 TEST_F(ErrorPageTest, DISABLED_DNSError_GoBack1) {
44 // Test that a DNS error occuring in the main frame does not result in an 43 // Test that a DNS error occuring in the main frame does not result in an
45 // additional session history entry. 44 // additional session history entry.
46 GURL test_url(URLRequestFailedDnsJob::kTestUrl); 45 GURL test_url(URLRequestFailedDnsJob::kTestUrl);
47 46
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 166
168 TEST_F(ErrorPageTest, Page404_GoBack) { 167 TEST_F(ErrorPageTest, Page404_GoBack) {
169 NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"title2.html")); 168 NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"title2.html"));
170 NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"page404.html")); 169 NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"page404.html"));
171 EXPECT_TRUE(WaitForTitleContaining("page404.html")); 170 EXPECT_TRUE(WaitForTitleContaining("page404.html"));
172 171
173 GetActiveTab()->GoBack(); 172 GetActiveTab()->GoBack();
174 173
175 EXPECT_TRUE(WaitForTitleMatching(L"Title Of Awesomeness")); 174 EXPECT_TRUE(WaitForTitleMatching(L"Title Of Awesomeness"));
176 } 175 }
OLDNEW
« no previous file with comments | « chrome/browser/automation/automation_provider.cc ('k') | chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698