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

Unified Diff: chrome/browser/policy/policy_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/policy/policy_browsertest.cc
diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc
index b56da1dc0adb3d77f1f4364506e06c9642d65cf0..aa51831d20de7396fa568c42b378cd8cf8998745 100644
--- a/chrome/browser/policy/policy_browsertest.cc
+++ b/chrome/browser/policy/policy_browsertest.cc
@@ -123,7 +123,6 @@
#include "content/public/test/test_navigation_observer.h"
#include "content/public/test/test_utils.h"
#include "content/test/net/url_request_failed_job.h"
-#include "content/test/net/url_request_mock_http_job.h"
#include "extensions/browser/extension_host.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/process_manager.h"
@@ -135,6 +134,7 @@
#include "net/base/net_util.h"
#include "net/base/url_util.h"
#include "net/http/http_stream_factory.h"
+#include "net/test/url_request/url_request_mock_http_job.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_filter.h"
#include "policy/policy_constants.h"
@@ -169,7 +169,7 @@
#endif
using content::BrowserThread;
-using content::URLRequestMockHTTPJob;
+using net::URLRequestMockHTTPJob;
using testing::Mock;
using testing::Return;
using testing::_;
@@ -224,8 +224,9 @@ void RedirectHostsToTestData(const char* const urls[], size_t size) {
for (size_t i = 0; i < size; ++i) {
const GURL url(urls[i]);
EXPECT_TRUE(url.is_valid());
- filter->AddUrlInterceptor(
- url, URLRequestMockHTTPJob::CreateInterceptor(base_path));
+ filter->AddUrlInterceptor(url,
+ URLRequestMockHTTPJob::CreateInterceptor(
+ base_path, BrowserThread::GetBlockingPool()));
}
}
@@ -618,8 +619,11 @@ class PolicyTest : public InProcessBrowserTest {
base::FilePath root_http;
PathService::Get(content::DIR_TEST_DATA, &root_http);
BrowserThread::PostTaskAndReply(
- BrowserThread::IO, FROM_HERE,
- base::Bind(URLRequestMockHTTPJob::AddUrlHandler, root_http),
+ BrowserThread::IO,
+ FROM_HERE,
+ base::Bind(URLRequestMockHTTPJob::AddUrlHandler,
+ root_http,
+ make_scoped_refptr(BrowserThread::GetBlockingPool())),
base::MessageLoop::current()->QuitWhenIdleClosure());
content::RunMessageLoop();
}
@@ -2686,9 +2690,14 @@ class RestoreOnStartupPolicyTest
command_line->InitFromArgv(argv);
ASSERT_TRUE(std::equal(argv.begin(), argv.end(),
command_line->argv().begin()));
+ }
- // Redirect the test URLs to the test data directory.
- RedirectHostsToTestData(kRestoredURLs, arraysize(kRestoredURLs));
+ virtual void SetUpOnMainThread() OVERRIDE {
+ BrowserThread::PostTask(
+ BrowserThread::IO,
+ FROM_HERE,
+ base::Bind(
+ RedirectHostsToTestData, kRestoredURLs, arraysize(kRestoredURLs)));
}
void HomepageIsNotNTP() {
« no previous file with comments | « chrome/browser/policy/cloud/test_request_interceptor.cc ('k') | chrome/browser/prerender/prerender_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698