0
Files
android_webview
apps
ash
base
build
build_overrides
buildtools
cc
chrome
chromecast
chromeos
clank
codelabs
components
content
crypto
dbus
device
docs
extensions
fuchsia_web
gin
google_apis
gpu
headless
infra
internal
ios
ios_internal
ipc
media
mojo
native_client
native_client_sdk
net
android
base
cert
cert_net
cookies
data
device_bound_sessions
disk_cache
dns
docs
extras
filter
first_party_sets
http
log
network_error_logging
nqe
ntlm
proxy_resolution
quic
reporting
server
shared_dictionary
socket
spdy
ssl
storage_access_api
test
android
embedded_test_server
spawned_test_server
url_request
win
cert_builder.cc
cert_builder.h
cert_test_util.cc
cert_test_util.h
cert_test_util_nss.cc
ct_test_util.cc
ct_test_util.h
event_waiter.h
gtest_util.h
key_util.cc
key_util.h
net_test_suite.cc
net_test_suite.h
python_utils.cc
python_utils.h
python_utils_unittest.cc
quic_simple_test_server.cc
quic_simple_test_server.h
revocation_builder.cc
revocation_builder.h
run_all_unittests.cc
scoped_disable_exit_on_dfatal.cc
scoped_disable_exit_on_dfatal.h
scoped_mutually_exclusive_feature_list.h
ssl_test_util.cc
ssl_test_util.h
test_certificate_data.h
test_connection_cost_observer.cc
test_connection_cost_observer.h
test_data_directory.cc
test_data_directory.h
test_doh_server.cc
test_doh_server.h
test_net_log_manager.cc
test_net_log_manager.h
test_with_task_environment.cc
test_with_task_environment.h
third_party
tools
traffic_annotation
url_request
websockets
BUILD.gn
COMMON_METADATA
DEPS
DIR_METADATA
OWNERS
PRESUBMIT.py
README.md
features.gni
pdf
ppapi
printing
remoting
rlz
sandbox
services
signing_keys
skia
sql
storage
styleguide
testing
third_party
tools
ui
url
v8
webkit
.clang-format
.clang-tidy
.clangd
.git-blame-ignore-revs
.gitallowed
.gitattributes
.gitignore
.gitmodules
.gn
.mailmap
.rustfmt.toml
.vpython3
.yapfignore
ATL_OWNERS
AUTHORS
BUILD.gn
CODE_OF_CONDUCT.md
CPPLINT.cfg
CRYPTO_OWNERS
DEPS
DIR_METADATA
LICENSE
LICENSE.chromium_os
OWNERS
PRESUBMIT.py
PRESUBMIT_test.py
PRESUBMIT_test_mocks.py
README.md
WATCHLISTS
codereview.settings
src/net/test/net_test_suite.h
Lei Zhang 58a1082455 Swap ref_counted.h for scoped_refptr.h when appropriate in //net.
At some point, scoped_refptr got split off into its own header. Use it
in //net headers when appropriate.

Bug: 1381627
Change-Id: I75ba08e1446e995ce437e1002f6087a3f81c020c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4011218
Reviewed-by: Adam Rice <ricea@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1068476}
2022-11-08 04:23:20 +00:00

48 lines
1.4 KiB
C++

// Copyright 2011 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_TEST_NET_TEST_SUITE_H_
#define NET_TEST_NET_TEST_SUITE_H_
#include <memory>
#include "base/memory/scoped_refptr.h"
#include "base/test/test_suite.h"
#include "build/build_config.h"
#include "net/dns/mock_host_resolver.h"
namespace net {
class NetworkChangeNotifier;
}
class NetTestSuite : public base::TestSuite {
public:
NetTestSuite(int argc, char** argv);
~NetTestSuite() override;
void Initialize() override;
void Shutdown() override;
protected:
// Called from within Initialize(), but separate so that derived classes
// can initialize the NetTestSuite instance only and not
// TestSuite::Initialize(). TestSuite::Initialize() performs some global
// initialization that can only be done once.
void InitializeTestThread();
// Same as above, except it does not create a mock
// NetworkChangeNotifier. Use this if your test needs to create and
// manage its own mock NetworkChangeNotifier, or if your test uses
// the production NetworkChangeNotifier.
void InitializeTestThreadNoNetworkChangeNotifier();
private:
std::unique_ptr<net::NetworkChangeNotifier> network_change_notifier_;
scoped_refptr<net::RuleBasedHostResolverProc> host_resolver_proc_;
net::ScopedDefaultHostResolverProc scoped_host_resolver_proc_;
};
#endif // NET_TEST_NET_TEST_SUITE_H_