diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-09 19:48:55 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-09 19:48:55 +0000 |
commit | 120f05fa80e35a372331dfe901e65c74383d3d30 (patch) | |
tree | 6db2020ab2f6f41805524b3aa693d04c146f4057 /chrome/test | |
parent | 45904e20797f8cd28a776ed0e40ba94dc4eef97e (diff) | |
download | chromium_src-120f05fa80e35a372331dfe901e65c74383d3d30.zip chromium_src-120f05fa80e35a372331dfe901e65c74383d3d30.tar.gz chromium_src-120f05fa80e35a372331dfe901e65c74383d3d30.tar.bz2 |
revert until I can figure out why the tests are hanging
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13448 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/in_process_browser_test.cc | 15 | ||||
-rw-r--r-- | chrome/test/in_process_browser_test.h | 8 | ||||
-rw-r--r-- | chrome/test/ui_test_utils.cc | 31 | ||||
-rw-r--r-- | chrome/test/ui_test_utils.h | 10 | ||||
-rw-r--r-- | chrome/test/unit/unittests.vcproj | 4 |
5 files changed, 11 insertions, 57 deletions
diff --git a/chrome/test/in_process_browser_test.cc b/chrome/test/in_process_browser_test.cc index 6699144..39114ee 100644 --- a/chrome/test/in_process_browser_test.cc +++ b/chrome/test/in_process_browser_test.cc @@ -125,7 +125,12 @@ void InProcessBrowserTest::SetUp() { scoped_refptr<net::RuleBasedHostMapper> host_mapper( new net::RuleBasedHostMapper()); - ConfigureHostMapper(host_mapper.get()); + // TODO(sky): Don't make a real dns lookup here or simulate a failing + // lookup. + host_mapper->AllowDirectLookup("*.google.com"); + // See http://en.wikipedia.org/wiki/Web_Proxy_Autodiscovery_Protocol + // We don't want the test code to use it. + host_mapper->AddSimulatedFailure("wpad"); net::ScopedHostMapper scoped_host_mapper(host_mapper.get()); BrowserMain(params); } @@ -216,11 +221,3 @@ void InProcessBrowserTest::RunTestOnMainThreadLoop() { MessageLoopForUI::current()->Quit(); } - -void InProcessBrowserTest::ConfigureHostMapper( - net::RuleBasedHostMapper* host_mapper) { - host_mapper->AllowDirectLookup("*.google.com"); - // See http://en.wikipedia.org/wiki/Web_Proxy_Autodiscovery_Protocol - // We don't want the test code to use it. - host_mapper->AddSimulatedFailure("wpad"); -} diff --git a/chrome/test/in_process_browser_test.h b/chrome/test/in_process_browser_test.h index 457516e..89de9b9 100644 --- a/chrome/test/in_process_browser_test.h +++ b/chrome/test/in_process_browser_test.h @@ -12,9 +12,6 @@ class Browser; class Profile; -namespace net { -class RuleBasedHostMapper; -} // Base class for tests wanting to bring up a browser in the unit test process. // Writing tests with InProcessBrowserTest is slightly different than that of @@ -67,11 +64,6 @@ class InProcessBrowserTest : public testing::Test, public NotificationObserver { // Override this rather than TestBody. virtual void RunTestOnMainThread() = 0; - // Allows subclasses to configure the host mapper. 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 ConfigureHostMapper(net::RuleBasedHostMapper* host_mapper); - // Starts an HTTP server. HTTPTestServer* StartHTTPServer(); diff --git a/chrome/test/ui_test_utils.cc b/chrome/test/ui_test_utils.cc index 6af1091..47e3ef2 100644 --- a/chrome/test/ui_test_utils.cc +++ b/chrome/test/ui_test_utils.cc @@ -20,11 +20,8 @@ namespace { // Used to block until a navigation completes. class NavigationNotificationObserver : public NotificationObserver { public: - NavigationNotificationObserver(NavigationController* controller, - int number_of_navigations) - : navigation_started_(false), - navigations_completed_(0), - number_of_navigations_(number_of_navigations) { + explicit NavigationNotificationObserver(NavigationController* controller) + : navigation_started_(false) { registrar_.Add(this, NotificationType::NAV_ENTRY_COMMITTED, Source<NavigationController>(controller)); registrar_.Add(this, NotificationType::LOAD_START, @@ -41,8 +38,7 @@ class NavigationNotificationObserver : public NotificationObserver { type == NotificationType::LOAD_START) { navigation_started_ = true; } else if (type == NotificationType::LOAD_STOP) { - if (navigation_started_ && - ++navigations_completed_ == number_of_navigations_) { + if (navigation_started_) { navigation_started_ = false; MessageLoopForUI::current()->Quit(); } @@ -55,12 +51,6 @@ class NavigationNotificationObserver : public NotificationObserver { // If true the navigation has started. bool navigation_started_; - // The number of navigations that have been completed. - int navigations_completed_; - - // The number of navigations to wait for. - int number_of_navigations_; - DISALLOW_COPY_AND_ASSIGN(NavigationNotificationObserver); }; @@ -76,26 +66,15 @@ void RunMessageLoop() { } void WaitForNavigation(NavigationController* controller) { - WaitForNavigations(controller, 1); -} - -void WaitForNavigations(NavigationController* controller, - int number_of_navigations) { - NavigationNotificationObserver observer(controller, number_of_navigations); + NavigationNotificationObserver observer(controller); } void NavigateToURL(Browser* browser, const GURL& url) { - NavigateToURLBlockUntilNavigationsComplete(browser, url, 1); -} - -void NavigateToURLBlockUntilNavigationsComplete(Browser* browser, - const GURL& url, - int number_of_navigations) { NavigationController* controller = browser->GetSelectedTabContents()->controller(); browser->OpenURLFromTab(browser->GetSelectedTabContents(), url, GURL(), CURRENT_TAB, PageTransition::TYPED); - WaitForNavigations(controller, number_of_navigations); + WaitForNavigation(controller); } } // namespace ui_test_utils diff --git a/chrome/test/ui_test_utils.h b/chrome/test/ui_test_utils.h index ced32d2..f0433b0 100644 --- a/chrome/test/ui_test_utils.h +++ b/chrome/test/ui_test_utils.h @@ -21,20 +21,10 @@ void RunMessageLoop(); // the navigation finishes. void WaitForNavigation(NavigationController* controller); -// Waits for |controller| to complete a navigation. This blocks until -// the specified number of navigations complete. -void WaitForNavigations(NavigationController* controller, - int number_of_navigations); - // Navigates the selected tab of |browser| to |url|, blocking until the // navigation finishes. void NavigateToURL(Browser* browser, const GURL& url); -// Navigates the selected tab of |browser| to |url|, blocking until the -// number of navigations specified complete. -void NavigateToURLBlockUntilNavigationsComplete(Browser* browser, - const GURL& url, - int number_of_navigations); } #endif // CHROME_TEST_UI_TEST_UTILS_H_ diff --git a/chrome/test/unit/unittests.vcproj b/chrome/test/unit/unittests.vcproj index 2bf265e..3f4dcec 100644 --- a/chrome/test/unit/unittests.vcproj +++ b/chrome/test/unit/unittests.vcproj @@ -708,10 +708,6 @@ > </File> <File - RelativePath="..\..\browser\search_engines\template_url_scraper_unittest.cc" - > - </File> - <File RelativePath="..\..\browser\search_engines\template_url_unittest.cc" > </File> |