| OLD | NEW |
| 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/test/test_server.h" | 10 #include "net/test/test_server.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 FilePath(FILE_PATH_LITERAL("title2.html")))); | 156 FilePath(FILE_PATH_LITERAL("title2.html")))); |
| 157 NavigateToURL(URLRequestMockHTTPJob::GetMockUrl( | 157 NavigateToURL(URLRequestMockHTTPJob::GetMockUrl( |
| 158 FilePath(FILE_PATH_LITERAL("iframe_dns_error.html")))); | 158 FilePath(FILE_PATH_LITERAL("iframe_dns_error.html")))); |
| 159 | 159 |
| 160 EXPECT_TRUE(GetActiveTab()->GoBack()); | 160 EXPECT_TRUE(GetActiveTab()->GoBack()); |
| 161 EXPECT_TRUE(GetActiveTab()->GoForward()); | 161 EXPECT_TRUE(GetActiveTab()->GoForward()); |
| 162 | 162 |
| 163 EXPECT_TRUE(WaitForTitleMatching(L"Blah")); | 163 EXPECT_TRUE(WaitForTitleMatching(L"Blah")); |
| 164 } | 164 } |
| 165 | 165 |
| 166 TEST_F(ErrorPageTest, IFrame404) { | 166 #if defined(OS_WIN) |
| 167 // Might be related to http://crbug.com/60937 |
| 168 #define MAYBE_IFrame404 FLAKY_IFrame404 |
| 169 #else |
| 170 #define MAYBE_IFrame404 IFrame404 |
| 171 #endif |
| 172 |
| 173 TEST_F(ErrorPageTest, MAYBE_IFrame404) { |
| 167 // iframes that have 404 pages should not trigger an alternate error page. | 174 // iframes that have 404 pages should not trigger an alternate error page. |
| 168 // In this test, the iframe sets the title of the parent page to "SUCCESS" | 175 // In this test, the iframe sets the title of the parent page to "SUCCESS" |
| 169 // when the iframe loads. If the iframe fails to load (because an alternate | 176 // when the iframe loads. If the iframe fails to load (because an alternate |
| 170 // error page loads instead), then the title will remain as "FAIL". | 177 // error page loads instead), then the title will remain as "FAIL". |
| 171 net::TestServer test_server(net::TestServer::TYPE_HTTP, | 178 net::TestServer test_server(net::TestServer::TYPE_HTTP, |
| 172 FilePath(FILE_PATH_LITERAL("chrome/test/data"))); | 179 FilePath(FILE_PATH_LITERAL("chrome/test/data"))); |
| 173 ASSERT_TRUE(test_server.Start()); | 180 ASSERT_TRUE(test_server.Start()); |
| 174 NavigateToURL(test_server.GetURL("files/iframe404.html")); | 181 NavigateToURL(test_server.GetURL("files/iframe404.html")); |
| 175 EXPECT_TRUE(WaitForTitleMatching(L"SUCCESS")); | 182 EXPECT_TRUE(WaitForTitleMatching(L"SUCCESS")); |
| 176 } | 183 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 194 // page. | 201 // page. |
| 195 NavigateToURLBlockUntilNavigationsComplete( | 202 NavigateToURLBlockUntilNavigationsComplete( |
| 196 URLRequestMockHTTPJob::GetMockUrl( | 203 URLRequestMockHTTPJob::GetMockUrl( |
| 197 FilePath(FILE_PATH_LITERAL("page404.html"))), 2); | 204 FilePath(FILE_PATH_LITERAL("page404.html"))), 2); |
| 198 EXPECT_TRUE(WaitForTitleMatching(L"Mock Link Doctor")); | 205 EXPECT_TRUE(WaitForTitleMatching(L"Mock Link Doctor")); |
| 199 | 206 |
| 200 EXPECT_TRUE(GetActiveTab()->GoBack()); | 207 EXPECT_TRUE(GetActiveTab()->GoBack()); |
| 201 | 208 |
| 202 EXPECT_TRUE(WaitForTitleMatching(L"Title Of Awesomeness")); | 209 EXPECT_TRUE(WaitForTitleMatching(L"Title Of Awesomeness")); |
| 203 } | 210 } |
| OLD | NEW |