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

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

Issue 10836324: Panels test cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: feedback change to remove redundant if-check Created 8 years, 4 months 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
« no previous file with comments | « chrome/browser/ui/panels/base_panel_browser_test.h ('k') | chrome/browser/ui/panels/panel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/panels/base_panel_browser_test.cc
diff --git a/chrome/browser/ui/panels/base_panel_browser_test.cc b/chrome/browser/ui/panels/base_panel_browser_test.cc
index b76480dafd0f1629044a253e28f0a71268173a2c..f42f4c38cac3a73a8b55144bab1c72caa4457491 100644
--- a/chrome/browser/ui/panels/base_panel_browser_test.cc
+++ b/chrome/browser/ui/panels/base_panel_browser_test.cc
@@ -271,24 +271,16 @@ void BasePanelBrowserTest::WaitForWindowSizeAvailable(Panel* panel) {
void BasePanelBrowserTest::WaitForBoundsAnimationFinished(Panel* panel) {
scoped_ptr<NativePanelTesting> panel_testing(
CreateNativePanelTesting(panel));
- content::WindowedNotificationObserver signal(
- chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED,
- content::Source<Panel>(panel));
- if (!panel_testing->IsAnimatingBounds())
- return;
- signal.Wait();
- EXPECT_TRUE(!panel_testing->IsAnimatingBounds());
-}
-
-void BasePanelBrowserTest::WaitForExpansionStateChanged(
- Panel* panel, Panel::ExpansionState expansion_state) {
- content::WindowedNotificationObserver signal(
- chrome::NOTIFICATION_PANEL_CHANGED_EXPANSION_STATE,
- content::Source<Panel>(panel));
- if (panel->expansion_state() == expansion_state)
- return;
- signal.Wait();
- EXPECT_EQ(expansion_state, panel->expansion_state());
+ // Sometimes there are several animations in sequence due to content
+ // auto resizing. Wait for all animations to finish.
+ while (panel_testing->IsAnimatingBounds()) {
+ content::WindowedNotificationObserver signal(
+ chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED,
+ content::Source<Panel>(panel));
+ if (!panel_testing->IsAnimatingBounds())
+ return;
+ signal.Wait();
+ }
}
BasePanelBrowserTest::CreatePanelParams::CreatePanelParams(
« no previous file with comments | « chrome/browser/ui/panels/base_panel_browser_test.h ('k') | chrome/browser/ui/panels/panel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698