diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-08 16:16:55 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-08 16:16:55 +0000 |
commit | 3e59bacae6bff857dfb5e3d3e8359dbde60ccb04 (patch) | |
tree | bfa6a819deb40647392a5b4db31d26e428eb0e37 /chrome/browser/autocomplete/autocomplete_browsertest.cc | |
parent | 714786e1b9566ca76388497904d2ebdb7fd111f5 (diff) | |
download | chromium_src-3e59bacae6bff857dfb5e3d3e8359dbde60ccb04.zip chromium_src-3e59bacae6bff857dfb5e3d3e8359dbde60ccb04.tar.gz chromium_src-3e59bacae6bff857dfb5e3d3e8359dbde60ccb04.tar.bz2 |
Revert 43950 - Revert 43931 [GTTF] Clean up browser tests:
[original revert broke compile; will disable tests in another CL instead]
use more ui_test_utils functions to simplify the code
expose more consistent and powerful utilities in ui_test_utils
minor style improvements
move some tests from DISABLED to FLAKY so we don't lose coverage
remove redundant timeouts
check more return values
TEST=browser_tests
BUG=none
Review URL: http://codereview.chromium.org/1571002
TBR=phajdan.jr@chromium.org
Review URL: http://codereview.chromium.org/1520026
TBR=viettrungluu@chromium.org, phajdan.jr@chromium.org
Review URL: http://codereview.chromium.org/1518020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43951 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/autocomplete_browsertest.cc')
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_browsertest.cc | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_browsertest.cc b/chrome/browser/autocomplete/autocomplete_browsertest.cc index 29a9b30..f54e535 100644 --- a/chrome/browser/autocomplete/autocomplete_browsertest.cc +++ b/chrome/browser/autocomplete/autocomplete_browsertest.cc @@ -12,8 +12,6 @@ #include "chrome/browser/location_bar.h" #include "chrome/browser/profile.h" #include "chrome/browser/tab_contents/tab_contents.h" -#include "chrome/common/notification_registrar.h" -#include "chrome/common/notification_service.h" #include "chrome/common/notification_type.h" #include "chrome/common/url_constants.h" #include "chrome/test/in_process_browser_test.h" @@ -36,8 +34,7 @@ std::wstring AutocompleteResultAsString(const AutocompleteResult& result) { } // namespace -class AutocompleteBrowserTest : public InProcessBrowserTest, - public NotificationObserver { +class AutocompleteBrowserTest : public InProcessBrowserTest { protected: LocationBar* GetLocationBar() const { return browser()->window()->GetLocationBar(); @@ -51,19 +48,8 @@ class AutocompleteBrowserTest : public InProcessBrowserTest, void WaitForHistoryBackendToLoad() { HistoryService* history_service = browser()->profile()->GetHistoryService(Profile::EXPLICIT_ACCESS); - if (!history_service->BackendLoaded()) { - NotificationRegistrar registrar; - registrar.Add(this, NotificationType::HISTORY_LOADED, - NotificationService::AllSources()); - ui_test_utils::RunMessageLoop(); - } - } - - virtual void Observe(NotificationType type, - const NotificationSource& source, - const NotificationDetails& details) { - DCHECK(type == NotificationType::HISTORY_LOADED); - MessageLoop::current()->Quit(); + if (!history_service->BackendLoaded()) + ui_test_utils::WaitForNotification(NotificationType::HISTORY_LOADED); } }; |