Commit c37f2efe authored by John Abd-El-Malek's avatar John Abd-El-Malek Committed by Commit Bot

Ensure that unit tests don't make network requests.

We already enforced this for browser tests.

Change-Id: I9481f3949f5ddfd71f54d6627243c4b4266d292c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1636458Reviewed-by: default avatarKen Rockot <rockot@google.com>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#665031}
parent a661c8fe
......@@ -12,6 +12,7 @@
#include "base/test/test_suite.h"
#include "build/build_config.h"
#include "content/browser/network_service_instance_impl.h"
#include "content/public/test/test_host_resolver.h"
#include "content/test/test_blink_web_unit_test_support.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/web/blink.h"
......@@ -103,6 +104,7 @@ UnitTestTestSuite::UnitTestTestSuite(base::TestSuite* test_suite,
#endif
DCHECK(test_suite);
blink_test_support_.reset(new TestBlinkWebUnitTestSupport);
test_host_resolver_ = std::make_unique<TestHostResolver>();
}
UnitTestTestSuite::~UnitTestTestSuite() = default;
......
......@@ -17,6 +17,7 @@ class TestSuite;
namespace content {
class TestBlinkWebUnitTestSupport;
class TestHostResolver;
// A special test suite that also initializes WebKit once for all unittests.
// This is useful for two reasons:
......@@ -39,6 +40,8 @@ class UnitTestTestSuite {
std::unique_ptr<TestBlinkWebUnitTestSupport> blink_test_support_;
std::unique_ptr<TestHostResolver> test_host_resolver_;
DISALLOW_COPY_AND_ASSIGN(UnitTestTestSuite);
};
......
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