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

Unified Diff: chrome/test/in_process_browser_test.h

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.h
diff --git a/chrome/test/in_process_browser_test.h b/chrome/test/in_process_browser_test.h
index ac7139c3fac4bc8cb9048b21489cf6ee518c57ec..053dce14d7e279926a790edd49d849db6dfac83f 100644
--- a/chrome/test/in_process_browser_test.h
+++ b/chrome/test/in_process_browser_test.h
@@ -5,6 +5,7 @@
#ifndef CHROME_TEST_IN_PROCESS_BROWSER_TEST_H_
#define CHROME_TEST_IN_PROCESS_BROWSER_TEST_H_
+#include "net/base/mock_host_resolver.h"
#include "net/url_request/url_request_unittest.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -70,11 +71,6 @@ class InProcessBrowserTest : public testing::Test {
// main thread before the browser is torn down.
virtual void CleanUpOnMainThread() {}
- // Allows subclasses to configure the host resolver procedure. By default
- // this blocks requests to google.com as Chrome pings that on startup and we
- // don't want to do that during testing.
- virtual void ConfigureHostResolverProc(net::RuleBasedHostResolverProc* proc);
-
// Invoked when a test is not finishing in a timely manner.
void TimedOut();
@@ -90,6 +86,12 @@ class InProcessBrowserTest : public testing::Test {
// This is invoked from Setup.
virtual Browser* CreateBrowser(Profile* profile);
+ // Returns the host resolver being used for the tests. Subclasses might want
+ // to configure it inside tests.
+ net::RuleBasedHostResolverProc* host_resolver() {
+ return host_resolver_.get();
+ }
+
// Sets some test states (see below for comments). Call this in your test
// constructor.
void set_show_window(bool show) { show_window_ = show; }
@@ -128,6 +130,9 @@ class InProcessBrowserTest : public testing::Test {
// Initial timeout value in ms.
int initial_timeout_;
+ // Host resolver to use during the test.
+ scoped_refptr<net::RuleBasedHostResolverProc> host_resolver_;
+
DISALLOW_COPY_AND_ASSIGN(InProcessBrowserTest);
};

Powered by Google App Engine
This is Rietveld 408576698