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

Unified Diff: chrome/browser/ui/panels/test_panel_strip_squeeze_observer.h

Issue 10914242: Improve panel tests by properly waiting for expected conditions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synced Created 8 years, 3 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
Index: chrome/browser/ui/panels/test_panel_strip_squeeze_observer.h
diff --git a/chrome/browser/ui/panels/test_panel_strip_squeeze_observer.h b/chrome/browser/ui/panels/test_panel_strip_squeeze_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..a7da45aa64f329064699d7f7c190d4acfb0283e8
--- /dev/null
+++ b/chrome/browser/ui/panels/test_panel_strip_squeeze_observer.h
@@ -0,0 +1,37 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_PANELS_TEST_PANEL_STRIP_SQUEEZE_OBSERVER_H_
+#define CHROME_BROWSER_UI_PANELS_TEST_PANEL_STRIP_SQUEEZE_OBSERVER_H_
+
+#include "chrome/browser/ui/panels/test_panel_notification_observer.h"
+
+class DockedPanelStrip;
+class Panel;
+
+// Custom notification observer for waiting on panel strip that squeezes
+// its panels to reflect a certain state.
+// Modeled after ui_test_utils notification observers.
+class PanelStripSqueezeObserver : public TestPanelNotificationObserver {
+ public:
+ // Register to listen for panel strip updated notifications
+ // from the specified strip to detect a change to the state
+ // where the |active_panel| is at full width and all other
+ // panels in the strip are squeezed.
+ PanelStripSqueezeObserver(DockedPanelStrip* strip, Panel* active_panel);
+ virtual ~PanelStripSqueezeObserver();
+
+ private:
+ // TestNotificationObserver override:
+ virtual bool AtExpectedState() OVERRIDE;
+
+ bool IsSqueezed(Panel* panel);
+
+ DockedPanelStrip* panel_strip_;
+ Panel* active_panel_;
+
+ DISALLOW_COPY_AND_ASSIGN(PanelStripSqueezeObserver);
+};
+
+#endif // CHROME_BROWSER_UI_PANELS_TEST_PANEL_STRIP_SQUEEZE_OBSERVER_H_

Powered by Google App Engine
This is Rietveld 408576698