diff options
Diffstat (limited to 'chrome/browser/chromeos')
3 files changed, 25 insertions, 2 deletions
diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc index 7748e5c..42793fe 100644 --- a/chrome/browser/chromeos/login/wizard_controller.cc +++ b/chrome/browser/chromeos/login/wizard_controller.cc @@ -25,6 +25,7 @@ #include "chrome/browser/chromeos/login/user_manager.h" #include "chrome/browser/chromeos/wm_ipc.h" #include "chrome/common/chrome_switches.h" +#include "chrome/common/notification_service.h" #include "views/accelerator.h" #include "views/painter.h" #include "views/screen.h" @@ -56,6 +57,13 @@ class ContentView : public views::View { AddAccelerator(accel_login_screen_); } + ~ContentView() { + NotificationService::current()->Notify( + NotificationType::WIZARD_CONTENT_VIEW_DESTROYED, + NotificationService::AllSources(), + NotificationService::NoDetails()); + } + bool AcceleratorPressed(const views::Accelerator& accel) { if (accel == accel_login_screen_) { WizardController* controller = WizardController::default_controller(); diff --git a/chrome/browser/chromeos/login/wizard_in_process_browser_test.cc b/chrome/browser/chromeos/login/wizard_in_process_browser_test.cc index ae94f0e..dc87e97 100644 --- a/chrome/browser/chromeos/login/wizard_in_process_browser_test.cc +++ b/chrome/browser/chromeos/login/wizard_in_process_browser_test.cc @@ -8,6 +8,7 @@ #include "chrome/browser/browser.h" #include "chrome/browser/chromeos/login/wizard_controller.h" #include "chrome/browser/views/browser_dialogs.h" +#include "chrome/test/ui_test_utils.h" namespace chromeos { @@ -26,6 +27,13 @@ Browser* WizardInProcessBrowserTest::CreateBrowser(Profile* profile) { void WizardInProcessBrowserTest::CleanUpOnMainThread() { delete controller_; + + // Observers and what not are notified after the views are deleted, which + // happens after a delay (because they are contained in a WidgetGtk which + // delays deleting itself). Run the message loop until we know the wizard + // has been deleted. + ui_test_utils::WaitForNotification( + NotificationType::WIZARD_CONTENT_VIEW_DESTROYED); } } // namespace chromeos diff --git a/chrome/browser/chromeos/panels/panel_browsertest.cc b/chrome/browser/chromeos/panels/panel_browsertest.cc index 6126a45e4..1ec09b2 100644 --- a/chrome/browser/chromeos/panels/panel_browsertest.cc +++ b/chrome/browser/chromeos/panels/panel_browsertest.cc @@ -43,7 +43,11 @@ IN_PROC_BROWSER_TEST_F(PanelTest, PanelOpenSmall) { GURL url("data:text/html," + HTML); CommandLine::ForCurrentProcess()->AppendSwitch( switches::kDisablePopupBlocking); - ui_test_utils::NavigateToURL(browser(), url); + + browser()->OpenURL(url, GURL(), CURRENT_TAB, PageTransition::TYPED); + + // Wait for notification that window.open has been processed. + ui_test_utils::WaitForNotification(NotificationType::TAB_ADDED); // Find the new browser. Browser* new_browser = NULL; @@ -78,7 +82,10 @@ IN_PROC_BROWSER_TEST_F(PanelTest, PanelOpenLarge) { CommandLine::ForCurrentProcess()->AppendSwitch( switches::kDisablePopupBlocking); int old_tab_count = browser()->tab_count(); - ui_test_utils::NavigateToURL(browser(), url); + browser()->OpenURL(url, GURL(), CURRENT_TAB, PageTransition::TYPED); + + // Wait for notification that window.open has been processed. + ui_test_utils::WaitForNotification(NotificationType::TAB_ADDED); // Shouldn't find a new browser. Browser* new_browser = NULL; |