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

Unified Diff: content/public/test/browser_test_base.h

Issue 2837813004: Sync the browser test host resolver with the network process before a test runs. (Closed)
Patch Set: review comments Created 3 years, 8 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
« no previous file with comments | « content/public/common/network_service_test.mojom ('k') | content/public/test/browser_test_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/browser_test_base.h
diff --git a/content/public/test/browser_test_base.h b/content/public/test/browser_test_base.h
index a404d0f5a1a56d5756e1de610d609b0703cfd3b5..30f7f0a93d5e489a033896652036f4c7f7debd01 100644
--- a/content/public/test/browser_test_base.h
+++ b/content/public/test/browser_test_base.h
@@ -9,6 +9,7 @@
#include "base/compiler_specific.h"
#include "base/threading/thread.h"
#include "build/build_config.h"
+#include "content/public/test/test_host_resolver.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/spawned_test_server/spawned_test_server.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -18,10 +19,6 @@ class CommandLine;
class FilePath;
}
-namespace net {
-class RuleBasedHostResolverProc;
-} // namespace net
-
namespace content {
class BrowserTestBase : public testing::Test {
@@ -51,7 +48,7 @@ class BrowserTestBase : public testing::Test {
// Returns the host resolver being used for the tests. Subclasses might want
// to configure it inside tests.
net::RuleBasedHostResolverProc* host_resolver() {
- return rule_based_resolver_.get();
+ return test_host_resolver_->host_resolver();
}
protected:
@@ -138,6 +135,10 @@ class BrowserTestBase : public testing::Test {
private:
void ProxyRunTestOnMainThreadLoop();
+ // When using the network process, update the host resolver rules that were
+ // added in SetUpOnMainThread.
+ void InitializeNetworkProcess();
+
// Testing server, started on demand.
std::unique_ptr<net::SpawnedTestServer> spawned_test_server_;
@@ -145,7 +146,7 @@ class BrowserTestBase : public testing::Test {
std::unique_ptr<net::EmbeddedTestServer> embedded_test_server_;
// Host resolver used during tests.
- scoped_refptr<net::RuleBasedHostResolverProc> rule_based_resolver_;
+ std::unique_ptr<TestHostResolver> test_host_resolver_;
// Expected exit code (default is 0).
int expected_exit_code_;
« no previous file with comments | « content/public/common/network_service_test.mojom ('k') | content/public/test/browser_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698