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

Unified Diff: content/public/test/test_host_resolver.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/test/browser_test_base.cc ('k') | content/public/test/test_host_resolver.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/test_host_resolver.h
diff --git a/content/public/test/test_host_resolver.h b/content/public/test/test_host_resolver.h
new file mode 100644
index 0000000000000000000000000000000000000000..1278970f04d30d13d54b6971162ea20f00ffa872
--- /dev/null
+++ b/content/public/test/test_host_resolver.h
@@ -0,0 +1,39 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_PUBLIC_TEST_TEST_HOST_RESOLVER_H_
+#define CONTENT_PUBLIC_TEST_TEST_HOST_RESOLVER_H_
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+
+namespace net {
+class HostResolverProc;
+class RuleBasedHostResolverProc;
+class ScopedDefaultHostResolverProc;
+}
+
+namespace content {
+class TestHostResolver {
+ public:
+ TestHostResolver();
+ ~TestHostResolver();
+
+ net::RuleBasedHostResolverProc* host_resolver() {
+ return rule_based_resolver_.get();
+ }
+
+ private:
+ // Host resolver used during tests.
+ scoped_refptr<net::HostResolverProc> local_resolver_;
+ scoped_refptr<net::RuleBasedHostResolverProc> rule_based_resolver_;
+ std::unique_ptr<net::ScopedDefaultHostResolverProc>
+ scoped_local_host_resolver_proc_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestHostResolver);
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_TEST_TEST_HOST_RESOLVER_H_
« no previous file with comments | « content/public/test/browser_test_base.cc ('k') | content/public/test/test_host_resolver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698