OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
7 #include "chrome/browser/net/url_request_mock_util.h" | 7 #include "chrome/browser/net/url_request_mock_util.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #include "chrome/browser/ui/browser_commands.h" | 9 #include "chrome/browser/ui/browser_commands.h" |
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 // Navigates forward in the history and waits for |num_navigations| to occur, | 62 // Navigates forward in the history and waits for |num_navigations| to occur, |
63 // and the title to change to |expected_title|. | 63 // and the title to change to |expected_title|. |
64 void GoForwardAndWaitForTitle(const std::string& expected_title, | 64 void GoForwardAndWaitForTitle(const std::string& expected_title, |
65 int num_navigations) { | 65 int num_navigations) { |
66 NavigateHistoryAndWaitForTitle(expected_title, | 66 NavigateHistoryAndWaitForTitle(expected_title, |
67 num_navigations, | 67 num_navigations, |
68 HISTORY_NAVIGATE_FORWARD); | 68 HISTORY_NAVIGATE_FORWARD); |
69 } | 69 } |
70 | 70 |
71 protected: | 71 protected: |
72 void SetUpOnMainThread() OVERRIDE { | 72 virtual void SetUpOnMainThread() OVERRIDE { |
73 BrowserThread::PostTask( | 73 BrowserThread::PostTask( |
74 BrowserThread::IO, FROM_HERE, | 74 BrowserThread::IO, FROM_HERE, |
75 base::Bind(&chrome_browser_net::SetUrlRequestMocksEnabled, true)); | 75 base::Bind(&chrome_browser_net::SetUrlRequestMocksEnabled, true)); |
76 } | 76 } |
77 | 77 |
78 // Returns a GURL that results in a DNS error. | 78 // Returns a GURL that results in a DNS error. |
79 GURL GetDnsErrorURL() const { | 79 GURL GetDnsErrorURL() const { |
80 return URLRequestFailedJob::GetMockHttpUrl(net::ERR_NAME_NOT_RESOLVED); | 80 return URLRequestFailedJob::GetMockHttpUrl(net::ERR_NAME_NOT_RESOLVED); |
81 } | 81 } |
82 | 82 |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 } | 238 } |
239 | 239 |
240 // Checks that the Link Doctor is not loaded when we receive an actual 404 page. | 240 // Checks that the Link Doctor is not loaded when we receive an actual 404 page. |
241 IN_PROC_BROWSER_TEST_F(ErrorPageTest, Page404) { | 241 IN_PROC_BROWSER_TEST_F(ErrorPageTest, Page404) { |
242 NavigateToURLAndWaitForTitle( | 242 NavigateToURLAndWaitForTitle( |
243 content::URLRequestMockHTTPJob::GetMockUrl( | 243 content::URLRequestMockHTTPJob::GetMockUrl( |
244 FilePath(FILE_PATH_LITERAL("page404.html"))), | 244 FilePath(FILE_PATH_LITERAL("page404.html"))), |
245 "SUCCESS", | 245 "SUCCESS", |
246 1); | 246 1); |
247 } | 247 } |
OLD | NEW |