| 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/url_request/url_request_unittest.h" | 10 #include "net/url_request/url_request_unittest.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 HTTPTestServer::CreateServer(L"chrome/test/data", NULL); | 152 HTTPTestServer::CreateServer(L"chrome/test/data", NULL); |
| 153 ASSERT_TRUE(NULL != server.get()); | 153 ASSERT_TRUE(NULL != server.get()); |
| 154 GURL test_url = server->TestServerPage("files/iframe404.html"); | 154 GURL test_url = server->TestServerPage("files/iframe404.html"); |
| 155 NavigateToURL(test_url); | 155 NavigateToURL(test_url); |
| 156 | 156 |
| 157 EXPECT_TRUE(WaitForTitleMatching(L"SUCCESS")); | 157 EXPECT_TRUE(WaitForTitleMatching(L"SUCCESS")); |
| 158 } | 158 } |
| 159 | 159 |
| 160 #if defined(OS_LINUX) | 160 #if defined(OS_LINUX) |
| 161 // TODO(phajdan.jr): This test is flaky on Linux, http://crbug.com/19361 | 161 // TODO(phajdan.jr): This test is flaky on Linux, http://crbug.com/19361 |
| 162 TEST_F(ErrorPageTest, DISABLED_Page404) { | 162 #define Page404 DISABLED_Page404 |
| 163 #else | 163 #define Page404_GoBack DISABLED_Page404_GoBack |
| 164 #endif |
| 165 |
| 164 TEST_F(ErrorPageTest, Page404) { | 166 TEST_F(ErrorPageTest, Page404) { |
| 165 #endif | |
| 166 NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"title2.html")); | 167 NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"title2.html")); |
| 167 NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"page404.html")); | 168 NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"page404.html")); |
| 168 | 169 |
| 169 EXPECT_TRUE(WaitForTitleContaining("page404.html")); | 170 EXPECT_TRUE(WaitForTitleContaining("page404.html")); |
| 170 } | 171 } |
| 171 | 172 |
| 172 TEST_F(ErrorPageTest, Page404_GoBack) { | 173 TEST_F(ErrorPageTest, Page404_GoBack) { |
| 173 NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"title2.html")); | 174 NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"title2.html")); |
| 174 NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"page404.html")); | 175 NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"page404.html")); |
| 175 EXPECT_TRUE(WaitForTitleContaining("page404.html")); | 176 EXPECT_TRUE(WaitForTitleContaining("page404.html")); |
| 176 | 177 |
| 177 GetActiveTab()->GoBack(); | 178 GetActiveTab()->GoBack(); |
| 178 | 179 |
| 179 EXPECT_TRUE(WaitForTitleMatching(L"Title Of Awesomeness")); | 180 EXPECT_TRUE(WaitForTitleMatching(L"Title Of Awesomeness")); |
| 180 } | 181 } |
| OLD | NEW |