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

Unified Diff: chrome/test/in_process_browser_test.cc

Issue 199074: Don't allow updating tabs to javascript URLs without host (Closed)
Patch Set: Remove unchanged file Created 11 years, 3 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
Index: chrome/test/in_process_browser_test.cc
diff --git a/chrome/test/in_process_browser_test.cc b/chrome/test/in_process_browser_test.cc
index a20c82880d8fbb07b2d9903a4159c04f9fca1d82..e04c94c04aba821e593cc0fc700276a1e86f0852 100644
--- a/chrome/test/in_process_browser_test.cc
+++ b/chrome/test/in_process_browser_test.cc
@@ -30,7 +30,6 @@
#include "chrome/common/notification_type.h"
#include "chrome/test/testing_browser_process.h"
#include "chrome/test/ui_test_utils.h"
-#include "net/base/mock_host_resolver.h"
#include "sandbox/src/dep.h"
extern int BrowserMain(const MainFunctionParams&);
@@ -130,11 +129,18 @@ void InProcessBrowserTest::SetUp() {
params.ui_task =
NewRunnableMethod(this, &InProcessBrowserTest::RunTestOnMainThreadLoop);
- scoped_refptr<net::RuleBasedHostResolverProc> host_resolver_proc(
- new net::RuleBasedHostResolverProc(NULL));
- ConfigureHostResolverProc(host_resolver_proc);
+ host_resolver_ = new net::RuleBasedHostResolverProc(NULL);
+
+ // Something inside the browser does this lookup implicitly. Make it fail
+ // to avoid external dependency. It won't break the tests.
+ host_resolver_->AddSimulatedFailure("*.google.com");
+
+ // See http://en.wikipedia.org/wiki/Web_Proxy_Autodiscovery_Protocol
+ // We don't want the test code to use it.
+ host_resolver_->AddSimulatedFailure("wpad");
+
net::ScopedDefaultHostResolverProc scoped_host_resolver_proc(
- host_resolver_proc);
+ host_resolver_.get());
BrowserMain(params);
}
@@ -236,17 +242,6 @@ void InProcessBrowserTest::RunTestOnMainThreadLoop() {
http_server_ = NULL;
}
-void InProcessBrowserTest::ConfigureHostResolverProc(
- net::RuleBasedHostResolverProc* host_resolver_proc) {
- // Something inside the browser does this lookup implicitly. Make it fail
- // to avoid external dependency. It won't break the tests.
- host_resolver_proc->AddSimulatedFailure("*.google.com");
-
- // See http://en.wikipedia.org/wiki/Web_Proxy_Autodiscovery_Protocol
- // We don't want the test code to use it.
- host_resolver_proc->AddSimulatedFailure("wpad");
-}
-
void InProcessBrowserTest::TimedOut() {
DCHECK(MessageLoopForUI::current()->IsNested());
« chrome/common/extensions/url_pattern.h ('K') | « chrome/test/in_process_browser_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698