Move code to allow dns queries (and accompanying
TODO) from each in-process ui test into the base
class, since it is really the base class that is
initiating these queries (by way of starting the
browser).
Review URL: http://codereview.chromium.org/56173
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13069 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/test/in_process_browser_test.cc b/chrome/test/in_process_browser_test.cc
index 3768a75a..e3c064d 100644
--- a/chrome/test/in_process_browser_test.cc
+++ b/chrome/test/in_process_browser_test.cc
@@ -20,6 +20,7 @@
#include "chrome/common/main_function_params.h"
#include "chrome/test/testing_browser_process.h"
#include "chrome/test/ui_test_utils.h"
+#include "net/base/host_resolver_unittest.h"
#include "sandbox/src/sandbox_factory.h"
#include "sandbox/src/dep.h"
@@ -110,6 +111,14 @@
MainFunctionParams params(*command_line, sandbox_wrapper, NULL);
params.ui_task =
NewRunnableMethod(this, &InProcessBrowserTest::RunTestOnMainThreadLoop);
+
+ // TODO(sky): Don't make a real dns lookup here or simulate a failing
+ // lookup. But if it's really needed then remove the TODO.
+ scoped_refptr<net::RuleBasedHostMapper> host_mapper(
+ new net::RuleBasedHostMapper());
+ host_mapper->AllowDirectLookup("*.google.com");
+ net::ScopedHostMapper scoped_host_mapper;
+ scoped_host_mapper.Init(host_mapper.get());
BrowserMain(params);
}