OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/test/test_timeouts.h" | 6 #include "base/test/test_timeouts.h" |
7 #include "base/threading/platform_thread.h" | 7 #include "base/threading/platform_thread.h" |
8 #include "chrome/test/automation/tab_proxy.h" | 8 #include "chrome/test/automation/tab_proxy.h" |
9 #include "chrome/test/ui/ui_test.h" | 9 #include "chrome/test/ui/ui_test.h" |
10 #include "chrome/browser/net/url_request_failed_dns_job.h" | 10 #include "content/browser/net/url_request_failed_dns_job.h" |
11 #include "chrome/browser/net/url_request_mock_http_job.h" | 11 #include "content/browser/net/url_request_mock_http_job.h" |
12 #include "net/test/test_server.h" | 12 #include "net/test/test_server.h" |
13 | 13 |
14 class ErrorPageTest : public UITest { | 14 class ErrorPageTest : public UITest { |
15 protected: | 15 protected: |
16 bool WaitForTitleMatching(const std::wstring& title) { | 16 bool WaitForTitleMatching(const std::wstring& title) { |
17 for (int i = 0; i < 10; ++i) { | 17 for (int i = 0; i < 10; ++i) { |
18 if (GetActiveTabTitle() == title) | 18 if (GetActiveTabTitle() == title) |
19 return true; | 19 return true; |
20 base::PlatformThread::Sleep(TestTimeouts::action_timeout_ms()); | 20 base::PlatformThread::Sleep(TestTimeouts::action_timeout_ms()); |
21 } | 21 } |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 EXPECT_TRUE(WaitForTitleMatching(L"Blah")); | 183 EXPECT_TRUE(WaitForTitleMatching(L"Blah")); |
184 } | 184 } |
185 | 185 |
186 // Checks that the Link Doctor is not loaded when we receive an actual 404 page. | 186 // Checks that the Link Doctor is not loaded when we receive an actual 404 page. |
187 TEST_F(ErrorPageTest, Page404) { | 187 TEST_F(ErrorPageTest, Page404) { |
188 NavigateToURL(URLRequestMockHTTPJob::GetMockUrl( | 188 NavigateToURL(URLRequestMockHTTPJob::GetMockUrl( |
189 FilePath(FILE_PATH_LITERAL("page404.html")))); | 189 FilePath(FILE_PATH_LITERAL("page404.html")))); |
190 | 190 |
191 EXPECT_TRUE(WaitForTitleMatching(L"SUCCESS")); | 191 EXPECT_TRUE(WaitForTitleMatching(L"SUCCESS")); |
192 } | 192 } |
OLD | NEW |