diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-11 06:28:15 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-11 06:28:15 +0000 |
commit | c7ad50f409be00bda164b2f60c29e2733eed1c94 (patch) | |
tree | aed183fbb1b944e6ef18c87e77cb49370ace834b /chrome/test/in_process_browser_test.h | |
parent | 7e922f33d88905196067d901a14910a62c48ac21 (diff) | |
download | chromium_src-c7ad50f409be00bda164b2f60c29e2733eed1c94.zip chromium_src-c7ad50f409be00bda164b2f60c29e2733eed1c94.tar.gz chromium_src-c7ad50f409be00bda164b2f60c29e2733eed1c94.tar.bz2 |
Don't allow updating tabs to javascript URLs without host
permissions to that tab.
Cleaned up a few things along the way:
- added a GetExtension() method to
ExtensionFunctionDispatcher and ExtensionFunction since it
was used in more than one place.
- Removed first param from chrome.test.failCallback() since
it wasn't used anywhere.
- Added a convenience CanAccessHost() method to Extension,
since it seems likely to be commonly used.
- Refactored setup of mock host resolver in browsertest,
since the way it was, you could only customize it at the
testsuite level, not the test level.
Review URL: http://codereview.chromium.org/199074
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25971 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/in_process_browser_test.h')
-rw-r--r-- | chrome/test/in_process_browser_test.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/chrome/test/in_process_browser_test.h b/chrome/test/in_process_browser_test.h index ac7139c..053dce1 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); }; |