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/crash_recovery_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/crash_recovery_browsertest.cc')
-rw-r--r-- | chrome/browser/crash_recovery_browsertest.cc | 36 |
1 files changed, 3 insertions, 33 deletions
diff --git a/chrome/browser/crash_recovery_browsertest.cc b/chrome/browser/crash_recovery_browsertest.cc index 846ddfe..1ee4cc4 100644 --- a/chrome/browser/crash_recovery_browsertest.cc +++ b/chrome/browser/crash_recovery_browsertest.cc @@ -6,8 +6,7 @@ #include "chrome/browser/browser.h" #include "chrome/browser/tab_contents/navigation_entry.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/page_transition_types.h" #include "chrome/common/url_constants.h" #include "chrome/test/in_process_browser_test.h" @@ -17,40 +16,11 @@ namespace { -// Used to block until a navigation completes. -class RendererCrashObserver : public NotificationObserver { - public: - RendererCrashObserver() {} - - void WaitForRendererCrash() { - registrar_.Add(this, NotificationType::TAB_CONTENTS_DISCONNECTED, - NotificationService::AllSources()); - ui_test_utils::RunMessageLoop(); - } - - virtual void Observe(NotificationType type, - const NotificationSource& source, - const NotificationDetails& details) { - if (type == NotificationType::TAB_CONTENTS_DISCONNECTED) { - registrar_.Remove(this, NotificationType::TAB_CONTENTS_DISCONNECTED, - NotificationService::AllSources()); - MessageLoopForUI::current()->Quit(); - } else { - NOTREACHED(); - } - } - - private: - NotificationRegistrar registrar_; - - DISALLOW_COPY_AND_ASSIGN(RendererCrashObserver); -}; - void SimulateRendererCrash(Browser* browser) { browser->OpenURL(GURL(chrome::kAboutCrashURL), GURL(), CURRENT_TAB, PageTransition::TYPED); - RendererCrashObserver crash_observer; - crash_observer.WaitForRendererCrash(); + ui_test_utils::WaitForNotification( + NotificationType::TAB_CONTENTS_DISCONNECTED); } } // namespace |