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

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

Issue 1391423002: net: Remove FilePath version of URLRequestMockHTTPJob::GetMockUrl(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix download_browsertest.cc typos Created 5 years, 2 months 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
OLDNEW
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 #if defined(OS_POSIX) 5 #if defined(OS_POSIX)
6 #include <signal.h> 6 #include <signal.h>
7 #endif 7 #endif
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 } 139 }
140 140
141 void NavigateToDataURL(const std::string& html_content, 141 void NavigateToDataURL(const std::string& html_content,
142 const char* expected_title) { 142 const char* expected_title) {
143 ui_test_utils::NavigateToURL(browser(), 143 ui_test_utils::NavigateToURL(browser(),
144 GURL("data:text/html," + html_content)); 144 GURL("data:text/html," + html_content));
145 CheckTitle(expected_title); 145 CheckTitle(expected_title);
146 } 146 }
147 147
148 void NavigateToNolistenersFileTwice() { 148 void NavigateToNolistenersFileTwice() {
149 GURL url(net::URLRequestMockHTTPJob::GetMockUrl( 149 GURL url(net::URLRequestMockHTTPJob::GetMockUrl("title2.html"));
150 base::FilePath(FILE_PATH_LITERAL("title2.html"))));
151 ui_test_utils::NavigateToURL(browser(), url); 150 ui_test_utils::NavigateToURL(browser(), url);
152 CheckTitle("Title Of Awesomeness"); 151 CheckTitle("Title Of Awesomeness");
153 ui_test_utils::NavigateToURL(browser(), url); 152 ui_test_utils::NavigateToURL(browser(), url);
154 CheckTitle("Title Of Awesomeness"); 153 CheckTitle("Title Of Awesomeness");
155 } 154 }
156 155
157 // Navigates to a URL asynchronously, then again synchronously. The first 156 // Navigates to a URL asynchronously, then again synchronously. The first
158 // load is purposely async to test the case where the user loads another 157 // load is purposely async to test the case where the user loads another
159 // page without waiting for the first load to complete. 158 // page without waiting for the first load to complete.
160 void NavigateToNolistenersFileTwiceAsync() { 159 void NavigateToNolistenersFileTwiceAsync() {
161 GURL url(net::URLRequestMockHTTPJob::GetMockUrl( 160 GURL url(net::URLRequestMockHTTPJob::GetMockUrl("title2.html"));
162 base::FilePath(FILE_PATH_LITERAL("title2.html"))));
163 ui_test_utils::NavigateToURLWithDisposition(browser(), url, CURRENT_TAB, 0); 161 ui_test_utils::NavigateToURLWithDisposition(browser(), url, CURRENT_TAB, 0);
164 ui_test_utils::NavigateToURL(browser(), url); 162 ui_test_utils::NavigateToURL(browser(), url);
165 CheckTitle("Title Of Awesomeness"); 163 CheckTitle("Title Of Awesomeness");
166 } 164 }
167 165
168 void LoadUrlAndQuitBrowser(const std::string& html_content, 166 void LoadUrlAndQuitBrowser(const std::string& html_content,
169 const char* expected_title) { 167 const char* expected_title) {
170 NavigateToDataURL(html_content, expected_title); 168 NavigateToDataURL(html_content, expected_title);
171 content::WindowedNotificationObserver window_observer( 169 content::WindowedNotificationObserver window_observer(
172 chrome::NOTIFICATION_BROWSER_CLOSED, 170 chrome::NOTIFICATION_BROWSER_CLOSED,
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 content::WindowedNotificationObserver window_observer( 637 content::WindowedNotificationObserver window_observer(
640 chrome::NOTIFICATION_BROWSER_CLOSED, 638 chrome::NOTIFICATION_BROWSER_CLOSED,
641 content::NotificationService::AllSources()); 639 content::NotificationService::AllSources());
642 chrome::CloseWindow(browser()); 640 chrome::CloseWindow(browser());
643 CrashTab(beforeunload_contents); 641 CrashTab(beforeunload_contents);
644 window_observer.Wait(); 642 window_observer.Wait();
645 } 643 }
646 644
647 // TODO(ojan): Add tests for unload/beforeunload that have multiple tabs 645 // TODO(ojan): Add tests for unload/beforeunload that have multiple tabs
648 // and multiple windows. 646 // and multiple windows.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698