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

Unified Diff: chrome/browser/errorpage_browsertest.cc

Issue 541743002: Move url_request_mock_http_job to net/test/url_request/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/errorpage_browsertest.cc
diff --git a/chrome/browser/errorpage_browsertest.cc b/chrome/browser/errorpage_browsertest.cc
index cb1a181c4b63bc274d6e99ed9e0267c8fcedc3f7..52d63afb1e88b8ae8e9fe50ec933a84f80429c77 100644
--- a/chrome/browser/errorpage_browsertest.cc
+++ b/chrome/browser/errorpage_browsertest.cc
@@ -38,12 +38,12 @@
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/test_navigation_observer.h"
#include "content/test/net/url_request_failed_job.h"
-#include "content/test/net/url_request_mock_http_job.h"
#include "net/base/net_errors.h"
#include "net/base/net_util.h"
#include "net/http/failing_http_transaction_factory.h"
#include "net/http/http_cache.h"
#include "net/test/spawned_test_server/spawned_test_server.h"
+#include "net/test/url_request/url_request_mock_http_job.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_filter.h"
@@ -215,9 +215,12 @@ class LinkDoctorInterceptor : public net::URLRequestInterceptor {
base::FilePath root_http;
PathService::Get(chrome::DIR_TEST_DATA, &root_http);
- return new content::URLRequestMockHTTPJob(
- request, network_delegate,
- root_http.AppendASCII("mock-link-doctor.json"));
+ return new net::URLRequestMockHTTPJob(
+ request,
+ network_delegate,
+ root_http.AppendASCII("mock-link-doctor.json"),
+ BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior(
+ base::SequencedWorkerPool::SKIP_ON_SHUTDOWN));
}
void WaitForRequests(int requests_to_wait_for) {
@@ -276,8 +279,10 @@ void InstallMockInterceptors(
// Add a mock for the search engine the error page will use.
base::FilePath root_http;
PathService::Get(chrome::DIR_TEST_DATA, &root_http);
- content::URLRequestMockHTTPJob::AddHostnameToFileHandler(
- search_url.host(), root_http.AppendASCII("title3.html"));
+ net::URLRequestMockHTTPJob::AddHostnameToFileHandler(
+ search_url.host(),
+ root_http.AppendASCII("title3.html"),
+ BrowserThread::GetBlockingPool());
}
class ErrorPageTest : public InProcessBrowserTest {
@@ -300,7 +305,7 @@ class ErrorPageTest : public InProcessBrowserTest {
void NavigateToFileURL(const base::FilePath::StringType& file_path) {
ui_test_utils::NavigateToURL(
browser(),
- content::URLRequestMockHTTPJob::GetMockUrl(base::FilePath(file_path)));
+ net::URLRequestMockHTTPJob::GetMockUrl(base::FilePath(file_path)));
}
// Navigates to the given URL and waits for |num_navigations| to occur, and
@@ -700,7 +705,7 @@ IN_PROC_BROWSER_TEST_F(ErrorPageTest, DNSError_DoClickLink) {
// navigation corrections.
IN_PROC_BROWSER_TEST_F(ErrorPageTest, IFrameDNSError_Basic) {
NavigateToURLAndWaitForTitle(
- content::URLRequestMockHTTPJob::GetMockUrl(
+ net::URLRequestMockHTTPJob::GetMockUrl(
base::FilePath(FILE_PATH_LITERAL("iframe_dns_error.html"))),
"Blah",
1);
@@ -814,7 +819,7 @@ IN_PROC_BROWSER_TEST_F(ErrorPageTest, IFrameDNSError_JavaScript) {
// 404 page.
IN_PROC_BROWSER_TEST_F(ErrorPageTest, Page404) {
NavigateToURLAndWaitForTitle(
- content::URLRequestMockHTTPJob::GetMockUrl(
+ net::URLRequestMockHTTPJob::GetMockUrl(
base::FilePath(FILE_PATH_LITERAL("page404.html"))),
"SUCCESS",
1);

Powered by Google App Engine
This is Rietveld 408576698