Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(514)

Side by Side Diff: chrome/browser/errorpage_browsertest.cc

Issue 8892011: Clean up TCW, make it solely a hub for 1:1 observer/helper objects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/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/tab_contents/tab_contents_wrapper.h" 9 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
10 #include "chrome/test/base/in_process_browser_test.h" 10 #include "chrome/test/base/in_process_browser_test.h"
11 #include "chrome/test/base/test_navigation_observer.h" 11 #include "chrome/test/base/test_navigation_observer.h"
12 #include "chrome/test/base/ui_test_utils.h" 12 #include "chrome/test/base/ui_test_utils.h"
13 #include "content/browser/net/url_request_failed_dns_job.h" 13 #include "content/browser/net/url_request_failed_dns_job.h"
14 #include "content/browser/net/url_request_mock_http_job.h" 14 #include "content/browser/net/url_request_mock_http_job.h"
15 #include "content/browser/tab_contents/tab_contents.h"
15 16
16 using content::BrowserThread; 17 using content::BrowserThread;
17 18
18 class ErrorPageTest : public InProcessBrowserTest { 19 class ErrorPageTest : public InProcessBrowserTest {
19 public: 20 public:
20 enum HistoryNavigationDirection { 21 enum HistoryNavigationDirection {
21 HISTORY_NAVIGATE_BACK, 22 HISTORY_NAVIGATE_BACK,
22 HISTORY_NAVIGATE_FORWARD, 23 HISTORY_NAVIGATE_FORWARD,
23 }; 24 };
24 25
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 // |num_navigations| to occur and the title to change to |expected_title|. 75 // |num_navigations| to occur and the title to change to |expected_title|.
75 void NavigateHistoryAndWaitForTitle(const std::string& expected_title, 76 void NavigateHistoryAndWaitForTitle(const std::string& expected_title,
76 int num_navigations, 77 int num_navigations,
77 HistoryNavigationDirection direction) { 78 HistoryNavigationDirection direction) {
78 ui_test_utils::TitleWatcher title_watcher( 79 ui_test_utils::TitleWatcher title_watcher(
79 browser()->GetSelectedTabContents(), 80 browser()->GetSelectedTabContents(),
80 ASCIIToUTF16(expected_title)); 81 ASCIIToUTF16(expected_title));
81 82
82 TestNavigationObserver test_navigation_observer( 83 TestNavigationObserver test_navigation_observer(
83 content::Source<NavigationController>( 84 content::Source<NavigationController>(
84 &browser()->GetSelectedTabContentsWrapper()->controller()), 85 &browser()->GetSelectedTabContentsWrapper()->tab_contents()->
86 controller()),
85 NULL, 87 NULL,
86 num_navigations); 88 num_navigations);
87 if (direction == HISTORY_NAVIGATE_BACK) { 89 if (direction == HISTORY_NAVIGATE_BACK) {
88 browser()->GoBack(CURRENT_TAB); 90 browser()->GoBack(CURRENT_TAB);
89 } else if (direction == HISTORY_NAVIGATE_FORWARD) { 91 } else if (direction == HISTORY_NAVIGATE_FORWARD) {
90 browser()->GoForward(CURRENT_TAB); 92 browser()->GoForward(CURRENT_TAB);
91 } else { 93 } else {
92 FAIL(); 94 FAIL();
93 } 95 }
94 test_navigation_observer.WaitForObservation(); 96 test_navigation_observer.WaitForObservation();
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 } 187 }
186 188
187 // Checks that the Link Doctor is not loaded when we receive an actual 404 page. 189 // Checks that the Link Doctor is not loaded when we receive an actual 404 page.
188 IN_PROC_BROWSER_TEST_F(ErrorPageTest, Page404) { 190 IN_PROC_BROWSER_TEST_F(ErrorPageTest, Page404) {
189 NavigateToURLAndWaitForTitle( 191 NavigateToURLAndWaitForTitle(
190 URLRequestMockHTTPJob::GetMockUrl( 192 URLRequestMockHTTPJob::GetMockUrl(
191 FilePath(FILE_PATH_LITERAL("page404.html"))), 193 FilePath(FILE_PATH_LITERAL("page404.html"))),
192 "SUCCESS", 194 "SUCCESS",
193 1); 195 1);
194 } 196 }
OLDNEW
« no previous file with comments | « chrome/browser/download/download_request_limiter.cc ('k') | chrome/browser/extensions/app_process_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698