| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 int num_navigations, | 87 int num_navigations, |
| 88 HistoryNavigationDirection direction) { | 88 HistoryNavigationDirection direction) { |
| 89 content::TitleWatcher title_watcher( | 89 content::TitleWatcher title_watcher( |
| 90 browser()->tab_strip_model()->GetActiveWebContents(), | 90 browser()->tab_strip_model()->GetActiveWebContents(), |
| 91 ASCIIToUTF16(expected_title)); | 91 ASCIIToUTF16(expected_title)); |
| 92 | 92 |
| 93 content::TestNavigationObserver test_navigation_observer( | 93 content::TestNavigationObserver test_navigation_observer( |
| 94 content::Source<NavigationController>( | 94 content::Source<NavigationController>( |
| 95 &browser()->tab_strip_model()->GetActiveWebContents()-> | 95 &browser()->tab_strip_model()->GetActiveWebContents()-> |
| 96 GetController()), | 96 GetController()), |
| 97 NULL, | |
| 98 num_navigations); | 97 num_navigations); |
| 99 if (direction == HISTORY_NAVIGATE_BACK) { | 98 if (direction == HISTORY_NAVIGATE_BACK) { |
| 100 chrome::GoBack(browser(), CURRENT_TAB); | 99 chrome::GoBack(browser(), CURRENT_TAB); |
| 101 } else if (direction == HISTORY_NAVIGATE_FORWARD) { | 100 } else if (direction == HISTORY_NAVIGATE_FORWARD) { |
| 102 chrome::GoForward(browser(), CURRENT_TAB); | 101 chrome::GoForward(browser(), CURRENT_TAB); |
| 103 } else { | 102 } else { |
| 104 FAIL(); | 103 FAIL(); |
| 105 } | 104 } |
| 106 test_navigation_observer.WaitForObservation( | 105 test_navigation_observer.WaitForObservation( |
| 107 base::Bind(&content::RunMessageLoop), | 106 base::Bind(&content::RunMessageLoop), |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 } | 237 } |
| 239 | 238 |
| 240 // Checks that the Link Doctor is not loaded when we receive an actual 404 page. | 239 // Checks that the Link Doctor is not loaded when we receive an actual 404 page. |
| 241 IN_PROC_BROWSER_TEST_F(ErrorPageTest, Page404) { | 240 IN_PROC_BROWSER_TEST_F(ErrorPageTest, Page404) { |
| 242 NavigateToURLAndWaitForTitle( | 241 NavigateToURLAndWaitForTitle( |
| 243 content::URLRequestMockHTTPJob::GetMockUrl( | 242 content::URLRequestMockHTTPJob::GetMockUrl( |
| 244 base::FilePath(FILE_PATH_LITERAL("page404.html"))), | 243 base::FilePath(FILE_PATH_LITERAL("page404.html"))), |
| 245 "SUCCESS", | 244 "SUCCESS", |
| 246 1); | 245 1); |
| 247 } | 246 } |
| OLD | NEW |