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

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

Issue 8775022: Add Panel::SetPanelBoundsInstantly for all platforms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix per feedback 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_browsertest.cc
diff --git a/chrome/browser/ui/panels/panel_browsertest.cc b/chrome/browser/ui/panels/panel_browsertest.cc
index b4292ac8b39ef126cda22f2dab1c082dc1dc1380..34dc3377a347396ea4e1e2e404bd09e7c80ef25a 100644
--- a/chrome/browser/ui/panels/panel_browsertest.cc
+++ b/chrome/browser/ui/panels/panel_browsertest.cc
@@ -882,6 +882,28 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest, MAYBE_AutoResize) {
panel->Close();
}
+IN_PROC_BROWSER_TEST_F(PanelBrowserTest, AnimateBounds) {
+ Panel* panel = CreatePanelWithBounds("PanelTest", gfx::Rect(0, 0, 100, 100));
+ scoped_ptr<NativePanelTesting> panel_testing(
+ NativePanelTesting::Create(panel->native_panel()));
+
+ // Set bounds with animation.
+ gfx::Rect bounds = gfx::Rect(10, 20, 150, 160);
+ panel->SetPanelBounds(bounds);
+ EXPECT_TRUE(panel_testing->IsAnimatingBounds());
+ WaitForBoundsAnimationFinished(panel);
+ EXPECT_FALSE(panel_testing->IsAnimatingBounds());
+ EXPECT_EQ(bounds, panel->GetBounds());
+
+ // Set bounds without animation.
+ bounds = gfx::Rect(30, 40, 200, 220);
+ panel->SetPanelBoundsInstantly(bounds);
+ EXPECT_FALSE(panel_testing->IsAnimatingBounds());
+ EXPECT_EQ(bounds, panel->GetBounds());
+
+ panel->Close();
+}
+
IN_PROC_BROWSER_TEST_F(PanelBrowserTest, RestoredBounds) {
// Disable mouse watcher. We don't care about mouse movements in this test.
PanelManager* panel_manager = PanelManager::GetInstance();

Powered by Google App Engine
This is Rietveld 408576698