Commit 81369708 authored by fdoray's avatar fdoray Committed by Commit bot

Use TaskScheduler instead of blocking pool in captive_portal_browsertest.cc.

The blocking pool is being deprecated in favor of TaskScheduler.

BUG=667892
R=mmenke@chromium.org

Review-Url: https://codereview.chromium.org/2843563002
Cr-Commit-Position: refs/heads/master@{#467726}
parent 5cff918d
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/threading/sequenced_worker_pool.h" #include "base/task_scheduler/post_task.h"
#include "base/values.h" #include "base/values.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/browser/captive_portal/captive_portal_service.h" #include "chrome/browser/captive_portal/captive_portal_service.h"
...@@ -482,6 +482,8 @@ URLRequestMockCaptivePortalJobFactory::Interceptor::MaybeInterceptRequest( ...@@ -482,6 +482,8 @@ URLRequestMockCaptivePortalJobFactory::Interceptor::MaybeInterceptRequest(
net::NetworkDelegate* network_delegate) const { net::NetworkDelegate* network_delegate) const {
EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
const base::TaskTraits kTraits = base::TaskTraits().MayBlock();
// The PathService is threadsafe. // The PathService is threadsafe.
base::FilePath root_http; base::FilePath root_http;
PathService::Get(chrome::DIR_TEST_DATA, &root_http); PathService::Get(chrome::DIR_TEST_DATA, &root_http);
...@@ -493,11 +495,9 @@ URLRequestMockCaptivePortalJobFactory::Interceptor::MaybeInterceptRequest( ...@@ -493,11 +495,9 @@ URLRequestMockCaptivePortalJobFactory::Interceptor::MaybeInterceptRequest(
// Once logged in to the portal, HTTPS requests return the page that was // Once logged in to the portal, HTTPS requests return the page that was
// actually requested. // actually requested.
return new URLRequestMockHTTPJob( return new URLRequestMockHTTPJob(
request, request, network_delegate,
network_delegate,
root_http.Append(FILE_PATH_LITERAL("title2.html")), root_http.Append(FILE_PATH_LITERAL("title2.html")),
BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior( base::CreateTaskRunnerWithTraits(kTraits));
base::SequencedWorkerPool::SKIP_ON_SHUTDOWN));
} else if (request->url() == kMockHttpsQuickTimeoutUrl) { } else if (request->url() == kMockHttpsQuickTimeoutUrl) {
if (behind_captive_portal_) if (behind_captive_portal_)
return new URLRequestFailedJob( return new URLRequestFailedJob(
...@@ -505,11 +505,9 @@ URLRequestMockCaptivePortalJobFactory::Interceptor::MaybeInterceptRequest( ...@@ -505,11 +505,9 @@ URLRequestMockCaptivePortalJobFactory::Interceptor::MaybeInterceptRequest(
// Once logged in to the portal, HTTPS requests return the page that was // Once logged in to the portal, HTTPS requests return the page that was
// actually requested. // actually requested.
return new URLRequestMockHTTPJob( return new URLRequestMockHTTPJob(
request, request, network_delegate,
network_delegate,
root_http.Append(FILE_PATH_LITERAL("title2.html")), root_http.Append(FILE_PATH_LITERAL("title2.html")),
BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior( base::CreateTaskRunnerWithTraits(kTraits));
base::SequencedWorkerPool::SKIP_ON_SHUTDOWN));
} else { } else {
// The URL should be the captive portal test URL. // The URL should be the captive portal test URL.
EXPECT_TRUE(request->url() == kMockCaptivePortalTestUrl || EXPECT_TRUE(request->url() == kMockCaptivePortalTestUrl ||
...@@ -520,27 +518,21 @@ URLRequestMockCaptivePortalJobFactory::Interceptor::MaybeInterceptRequest( ...@@ -520,27 +518,21 @@ URLRequestMockCaptivePortalJobFactory::Interceptor::MaybeInterceptRequest(
// by the captive portal. // by the captive portal.
if (request->url() == kMockCaptivePortal511Url) { if (request->url() == kMockCaptivePortal511Url) {
return new URLRequestMockHTTPJob( return new URLRequestMockHTTPJob(
request, request, network_delegate,
network_delegate,
root_http.Append(FILE_PATH_LITERAL("captive_portal/page511.html")), root_http.Append(FILE_PATH_LITERAL("captive_portal/page511.html")),
BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior( base::CreateTaskRunnerWithTraits(kTraits));
base::SequencedWorkerPool::SKIP_ON_SHUTDOWN));
} }
return new URLRequestMockHTTPJob( return new URLRequestMockHTTPJob(
request, request, network_delegate,
network_delegate,
root_http.Append(FILE_PATH_LITERAL("captive_portal/login.html")), root_http.Append(FILE_PATH_LITERAL("captive_portal/login.html")),
BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior( base::CreateTaskRunnerWithTraits(kTraits));
base::SequencedWorkerPool::SKIP_ON_SHUTDOWN));
} }
// After logging in to the portal, the test URLs return a 204 response. // After logging in to the portal, the test URLs return a 204 response.
return new URLRequestMockHTTPJob( return new URLRequestMockHTTPJob(
request, request, network_delegate,
network_delegate,
root_http.Append(FILE_PATH_LITERAL("captive_portal/page204.html")), root_http.Append(FILE_PATH_LITERAL("captive_portal/page204.html")),
BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior( base::CreateTaskRunnerWithTraits(kTraits));
base::SequencedWorkerPool::SKIP_ON_SHUTDOWN));
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment