From eb3895186d79897fc17310cae771ce2d8df32066 Mon Sep 17 00:00:00 2001 From: "jcivelli@chromium.org" Date: Mon, 19 Apr 2010 05:29:14 +0000 Subject: Attempt at fixing flakyness of the browser test: BrowserTest.PageLanguageDetection. BUG=40962 TEST=The test should not be flaky anymore. Review URL: http://codereview.chromium.org/1642002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44903 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/test/ui_test_utils.cc | 31 ------------------------------- 1 file changed, 31 deletions(-) (limited to 'chrome/test/ui_test_utils.cc') diff --git a/chrome/test/ui_test_utils.cc b/chrome/test/ui_test_utils.cc index 8b86ff8..dec305b 100644 --- a/chrome/test/ui_test_utils.cc +++ b/chrome/test/ui_test_utils.cc @@ -215,32 +215,6 @@ class DownloadsCompleteObserver : public DownloadManager::Observer, DISALLOW_COPY_AND_ASSIGN(DownloadsCompleteObserver); }; -class LanguageDetectionNotificationObserver : public NotificationObserver { - public: - explicit LanguageDetectionNotificationObserver(TabContents* tab) { - registrar_.Add(this, NotificationType::TAB_LANGUAGE_DETERMINED, - Source(tab)); - ui_test_utils::RunMessageLoop(); - } - - virtual void Observe(NotificationType type, - const NotificationSource& source, - const NotificationDetails& details) { - language_ = *(Details(details).ptr()); - MessageLoopForUI::current()->Quit(); - } - - std::string language() const { - return language_; - } - - private: - NotificationRegistrar registrar_; - std::string language_; - - DISALLOW_COPY_AND_ASSIGN(LanguageDetectionNotificationObserver); -}; - class FindInPageNotificationObserver : public NotificationObserver { public: explicit FindInPageNotificationObserver(TabContents* parent_tab) @@ -543,11 +517,6 @@ void WaitForFocusInBrowser(Browser* browser) { Source(browser)); } -std::string WaitForLanguageDetection(TabContents* tab) { - LanguageDetectionNotificationObserver observer(tab); - return observer.language(); -} - int FindInPage(TabContents* tab_contents, const string16& search_string, bool forward, bool match_case, int* ordinal) { tab_contents->StartFinding(search_string, forward, match_case); -- cgit v1.1