Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7996)

Unified Diff: chrome/browser/ui/panels/panel_browser_view_browsertest.cc

Issue 8505047: Fix panels being removed from PanelManager prematurely. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Got rid of timeout by adding Details to notification from RenderViewHost. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/panels/panel_browser_view_browsertest.cc
diff --git a/chrome/browser/ui/panels/panel_browser_view_browsertest.cc b/chrome/browser/ui/panels/panel_browser_view_browsertest.cc
index c18bb23c01296786e4e5ababcd2c07be4e5831b6..96eac11c26c546a9f124cef8bfd783800c10db34 100644
--- a/chrome/browser/ui/panels/panel_browser_view_browsertest.cc
+++ b/chrome/browser/ui/panels/panel_browser_view_browsertest.cc
@@ -162,6 +162,14 @@ class PanelBrowserViewTest : public BasePanelBrowserTest {
}
}
+ void ClosePanelAndWaitForNotification(Panel* panel) {
+ ui_test_utils::WindowedNotificationObserver signal(
+ chrome::NOTIFICATION_PANEL_DELETED,
jennb 2011/11/11 21:33:16 Should use BROWSER_CLOSED notification here to ver
prasadt 2011/11/11 22:02:44 Done.
+ content::Source<Panel>(panel));
+ panel->Close();
+ signal.Wait();
+ }
+
// We put all the testing logic in this class instead of the test so that
// we do not need to declare each new test as a friend of PanelBrowserView
// for the purpose of accessing its private members.
@@ -291,9 +299,9 @@ class PanelBrowserViewTest : public BasePanelBrowserTest {
0, 0));
browser_view1->OnTitlebarMouseReleased();
- panel1->Close();
- panel2->Close();
- panel3->Close();
+ ClosePanelAndWaitForNotification(panel1);
+ ClosePanelAndWaitForNotification(panel2);
+ ClosePanelAndWaitForNotification(panel3);
EXPECT_EQ(0, panel_manager->minimized_panel_count());
}

Powered by Google App Engine
This is Rietveld 408576698