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

Unified Diff: net/base/run_all_unittests.cc

Issue 18775: Add more unit tests for net/base/host_resolver. (Closed)
Patch Set: add fixes, and actually use previous mapper Created 11 years, 11 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 | « net/base/host_resolver_unittest.cc ('k') | net/base/scoped_host_mapper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/run_all_unittests.cc
diff --git a/net/base/run_all_unittests.cc b/net/base/run_all_unittests.cc
index 71dada9d0199ea2ca7295efbd35e22ee1aabf4ee..15741e459c7900fcfad6395af2f600697c56f1a1 100644
--- a/net/base/run_all_unittests.cc
+++ b/net/base/run_all_unittests.cc
@@ -28,16 +28,20 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "base/message_loop.h"
+#include "base/ref_counted.h"
#include "base/test_suite.h"
-#include "net/base/scoped_host_mapper.h"
+#include "net/base/host_resolver_unittest.h"
class NetTestSuite : public TestSuite {
public:
- NetTestSuite(int argc, char** argv) : TestSuite(argc, argv) {
+ NetTestSuite(int argc, char** argv)
+ : TestSuite(argc, argv),
+ host_mapper_(new net::RuleBasedHostMapper()),
+ scoped_host_mapper_(host_mapper_.get()) {
// In case any attempts are made to resolve host names, force them all to
// be mapped to localhost. This prevents DNS queries from being sent in
// the process of running these unit tests.
- host_mapper_.AddRule("*", "127.0.0.1");
+ host_mapper_->AddRule("*", "127.0.0.1");
}
virtual void Initialize() {
@@ -56,7 +60,8 @@ class NetTestSuite : public TestSuite {
private:
scoped_ptr<MessageLoop> message_loop_;
- net::ScopedHostMapper host_mapper_;
+ scoped_refptr<net::RuleBasedHostMapper> host_mapper_;
+ net::ScopedHostMapper scoped_host_mapper_;
};
int main(int argc, char** argv) {
« no previous file with comments | « net/base/host_resolver_unittest.cc ('k') | net/base/scoped_host_mapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698