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

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

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
« no previous file with comments | « chrome/browser/ui/panels/panel_browsertest.cc ('k') | chrome/browser/ui/panels/panel_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/panels/panel_drag_browsertest.cc
diff --git a/chrome/browser/ui/panels/panel_drag_browsertest.cc b/chrome/browser/ui/panels/panel_drag_browsertest.cc
index e87e87875bbe784d9fffda0d86d9b3ed76d86c9a..6bc24c5a07e51f5d1c7dbbe36d3577e1bb5470f3 100644
--- a/chrome/browser/ui/panels/panel_drag_browsertest.cc
+++ b/chrome/browser/ui/panels/panel_drag_browsertest.cc
@@ -10,6 +10,10 @@
#include "chrome/browser/ui/panels/panel.h"
#include "chrome/browser/ui/panels/panel_drag_controller.h"
#include "chrome/browser/ui/panels/panel_manager.h"
+#include "chrome/browser/ui/panels/test_panel_strip_squeeze_observer.h"
+#include "chrome/common/chrome_notification_types.h"
+#include "content/public/browser/notification_service.h"
+#include "content/public/test/test_utils.h"
class PanelDragBrowserTest : public BasePanelBrowserTest {
public:
@@ -1221,6 +1225,10 @@ IN_PROC_BROWSER_TEST_F(PanelDragBrowserTest, AttachWithSqueeze) {
ASSERT_EQ(3, detached_strip->num_panels());
ASSERT_EQ(4, docked_strip->num_panels());
+ // Wait for active states to settle.
+ PanelStripSqueezeObserver panel7_settled(docked_strip, panel7);
+ panel7_settled.Wait();
+
gfx::Point detached_position1 = panel1->GetBounds().origin();
gfx::Point detached_position2 = panel2->GetBounds().origin();
gfx::Point detached_position3 = panel3->GetBounds().origin();
@@ -1266,7 +1274,8 @@ IN_PROC_BROWSER_TEST_F(PanelDragBrowserTest, AttachWithSqueeze) {
#else
// The last panel is active so these positions do not change.
// TODO (ABurago) this is wrong behavior, a panel should activate
- // when it is dragged. Change the test when the behavior is fixed.
+ // when it is dragged (it does in real usage, but not when drag is
+ // simulated in a test). Change this test when the behavior is fixed.
EXPECT_EQ(true, panel7->IsActive());
EXPECT_EQ(panel7->GetBounds().width(), panel7->GetRestoredBounds().width());
« no previous file with comments | « chrome/browser/ui/panels/panel_browsertest.cc ('k') | chrome/browser/ui/panels/panel_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698