Commit f265872d authored by Matt Menke's avatar Matt Menke Committed by Commit Bot

Move a couple test files from content/test to services/network.

These are testing private services/network/ classes, so should be in
services/network/.

Bug: None
Change-Id: I8f736112feb755c035e88570a180cc6debc128e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1907073Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Commit-Queue: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#714900}
parent ef2f4a29
......@@ -300,8 +300,6 @@ jumbo_static_library("test_support") {
"test_content_browser_client.h",
"test_content_client.cc",
"test_content_client.h",
"test_mojo_proxy_resolver_factory.cc",
"test_mojo_proxy_resolver_factory.h",
"test_navigation_url_loader.cc",
"test_navigation_url_loader.h",
"test_navigation_url_loader_delegate.cc",
......@@ -1906,9 +1904,7 @@ test("content_unittests") {
"../renderer/worker/worker_thread_registry_unittest.cc",
"../test/renderer_audio_output_stream_factory_context_impl_unittest.cc",
"navigation_simulator_unittest.cc",
"proxy_service_mojo_unittest.cc",
"test_render_frame_host_unittest.cc",
"url_request_context_builder_mojo_unittest.cc",
]
if (is_mac) {
......@@ -2019,7 +2015,6 @@ test("content_unittests") {
"//services/network:test_support",
"//services/network/public/cpp",
"//services/network/public/mojom",
"//services/proxy_resolver/:lib",
"//services/service_manager/public/cpp/test:test_support",
"//services/video_capture/public/cpp:mocks",
"//services/video_capture/public/mojom",
......
......@@ -356,6 +356,10 @@ source_set("tests") {
if (!is_ios) {
sources += [
"proxy_resolver_factory_mojo_unittest.cc",
"proxy_service_mojo_unittest.cc",
"test_mojo_proxy_resolver_factory.cc",
"test_mojo_proxy_resolver_factory.h",
"url_request_context_builder_mojo_unittest.cc",
"websocket_throttler_unittest.cc",
]
......@@ -408,6 +412,10 @@ source_set("tests") {
if (trial_comparison_cert_verifier_supported) {
sources += [ "trial_comparison_cert_verifier_mojo_unittest.cc" ]
}
if (!is_ios) {
deps += [ "//services/proxy_resolver:lib" ]
}
}
jumbo_source_set("test_support") {
......
......@@ -21,3 +21,11 @@ include_rules = [
"+third_party/boringssl/src/include",
"+url",
]
specific_include_rules = {
# Some tests use a real proxy_resolver::ProxyResolverImpl.
"test_mojo_proxy_resolver_factory\.h": [
"+services/proxy_resolver/proxy_resolver_factory_impl.h",
],
}
\ No newline at end of file
......@@ -15,7 +15,6 @@
#include "base/test/task_environment.h"
#include "base/values.h"
#include "build/build_config.h"
#include "content/test/test_mojo_proxy_resolver_factory.h"
#include "net/base/completion_once_callback.h"
#include "net/base/network_delegate_impl.h"
#include "net/base/test_completion_callback.h"
......@@ -31,6 +30,7 @@
#include "net/test/event_waiter.h"
#include "net/test/gtest_util.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "services/network/test_mojo_proxy_resolver_factory.h"
#include "services/proxy_resolver/public/mojom/proxy_resolver.mojom.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
......@@ -38,7 +38,7 @@
using net::test::IsOk;
namespace content {
namespace network {
namespace {
......@@ -116,8 +116,7 @@ class ProxyServiceMojoTest : public testing::Test {
mock_host_resolver_.rules()->AddRule("example.com", "1.2.3.4");
fetcher_ = new net::MockPacFileFetcher;
proxy_resolution_service_ =
network::CreateProxyResolutionServiceUsingMojoFactory(
proxy_resolution_service_ = CreateProxyResolutionServiceUsingMojoFactory(
proxy_resolver::mojom::ProxyResolverFactoryPtr(
test_mojo_proxy_resolver_factory_.CreateFactoryRemote()),
std::make_unique<net::ProxyConfigServiceFixed>(
......@@ -130,7 +129,7 @@ class ProxyServiceMojoTest : public testing::Test {
}
base::test::TaskEnvironment task_environment_;
content::TestMojoProxyResolverFactory test_mojo_proxy_resolver_factory_;
TestMojoProxyResolverFactory test_mojo_proxy_resolver_factory_;
TestNetworkDelegate network_delegate_;
net::MockHostResolver mock_host_resolver_;
// Owned by |proxy_resolution_service_|.
......@@ -234,4 +233,4 @@ TEST_F(ProxyServiceMojoTest, ErrorOnInitialization) {
CheckCapturedNetLogEntries(net_log_.GetEntries());
}
} // namespace content
} // namespace network
......@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/test/test_mojo_proxy_resolver_factory.h"
#include "services/network/test_mojo_proxy_resolver_factory.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/logging.h"
namespace content {
namespace network {
TestMojoProxyResolverFactory::TestMojoProxyResolverFactory()
: proxy_resolver_factory_impl_(factory_.BindNewPipeAndPassReceiver()) {}
......@@ -30,4 +30,4 @@ TestMojoProxyResolverFactory::CreateFactoryRemote() {
return receiver_.BindNewPipeAndPassRemote();
}
} // namespace content
} // namespace network
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_TEST_TEST_MOJO_PROXY_RESOLVER_FACTORY_H_
#define CONTENT_TEST_TEST_MOJO_PROXY_RESOLVER_FACTORY_H_
#ifndef SERVICES_NETWORK_TEST_MOJO_PROXY_RESOLVER_FACTORY_H_
#define SERVICES_NETWORK_TEST_MOJO_PROXY_RESOLVER_FACTORY_H_
#include <memory>
#include <string>
......@@ -14,7 +14,7 @@
#include "services/proxy_resolver/proxy_resolver_factory_impl.h"
#include "services/proxy_resolver/public/mojom/proxy_resolver.mojom.h"
namespace content {
namespace network {
// MojoProxyResolverFactory that runs PAC scripts in-process, for tests.
class TestMojoProxyResolverFactory
......@@ -48,6 +48,6 @@ class TestMojoProxyResolverFactory
DISALLOW_COPY_AND_ASSIGN(TestMojoProxyResolverFactory);
};
} // namespace content
} // namespace network
#endif // CONTENT_TEST_TEST_MOJO_PROXY_RESOLVER_FACTORY_H_
#endif // SERVICES_NETWORK_TEST_MOJO_PROXY_RESOLVER_FACTORY_H_
......@@ -8,7 +8,6 @@
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/test/task_environment.h"
#include "content/test/test_mojo_proxy_resolver_factory.h"
#include "net/base/host_port_pair.h"
#include "net/proxy_resolution/proxy_config.h"
#include "net/proxy_resolution/proxy_config_service_fixed.h"
......@@ -20,6 +19,7 @@
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_test_util.h"
#include "services/network/test_mojo_proxy_resolver_factory.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
#include "url/gurl.h"
......@@ -28,7 +28,7 @@
#include "services/network/mock_mojo_dhcp_wpad_url_client.h"
#endif // defined(OS_CHROMEOS)
namespace content {
namespace network {
namespace {
......@@ -61,7 +61,7 @@ class URLRequestContextBuilderMojoTest : public PlatformTest {
base::test::TaskEnvironment task_environment_;
TestMojoProxyResolverFactory test_mojo_proxy_resolver_factory_;
net::EmbeddedTestServer test_server_;
network::URLRequestContextBuilderMojo builder_;
URLRequestContextBuilderMojo builder_;
};
TEST_F(URLRequestContextBuilderMojoTest, MojoProxyResolver) {
......@@ -78,9 +78,8 @@ TEST_F(URLRequestContextBuilderMojoTest, MojoProxyResolver) {
test_mojo_proxy_resolver_factory_.CreateFactoryRemote()));
#if defined(OS_CHROMEOS)
builder_.SetDhcpWpadUrlClient(network::mojom::DhcpWpadUrlClientPtr(
network::MockMojoDhcpWpadUrlClient::CreateWithSelfOwnedReceiver(
std::string())));
builder_.SetDhcpWpadUrlClient(mojom::DhcpWpadUrlClientPtr(
MockMojoDhcpWpadUrlClient::CreateWithSelfOwnedReceiver(std::string())));
#endif // defined(OS_CHROMEOS)
std::unique_ptr<net::URLRequestContext> context(builder_.Build());
......@@ -116,9 +115,8 @@ TEST_F(URLRequestContextBuilderMojoTest, ShutdownWithHungRequest) {
test_mojo_proxy_resolver_factory_.CreateFactoryRemote()));
#if defined(OS_CHROMEOS)
builder_.SetDhcpWpadUrlClient(network::mojom::DhcpWpadUrlClientPtr(
network::MockMojoDhcpWpadUrlClient::CreateWithSelfOwnedReceiver(
std::string())));
builder_.SetDhcpWpadUrlClient(mojom::DhcpWpadUrlClientPtr(
MockMojoDhcpWpadUrlClient::CreateWithSelfOwnedReceiver(std::string())));
#endif // defined(OS_CHROMEOS)
std::unique_ptr<net::URLRequestContext> context(builder_.Build());
......@@ -141,4 +139,4 @@ TEST_F(URLRequestContextBuilderMojoTest, ShutdownWithHungRequest) {
} // namespace
} // namespace content
} // namespace network
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