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

Side by Side Diff: chrome/browser/ui/panels/panel_browsertest.cc

Issue 9403035: Refactor intra-strip panel drags by introducing PanelDragController. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix per feedback Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/download/download_service.h" 8 #include "chrome/browser/download/download_service.h"
9 #include "chrome/browser/download/download_service_factory.h" 9 #include "chrome/browser/download/download_service_factory.h"
10 #include "chrome/browser/net/url_request_mock_util.h" 10 #include "chrome/browser/net/url_request_mock_util.h"
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 DRAG_ACTION_BEGIN | DRAG_ACTION_CANCEL); 763 DRAG_ACTION_BEGIN | DRAG_ACTION_CANCEL);
764 } 764 }
765 765
766 panel1->Close(); 766 panel1->Close();
767 panel2->Close(); 767 panel2->Close();
768 panel3->Close(); 768 panel3->Close();
769 } 769 }
770 770
771 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, NotDraggable) { 771 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, NotDraggable) {
772 Panel* panel = CreatePanel("panel"); 772 Panel* panel = CreatePanel("panel");
773 panel->set_draggable(false); 773 // This is used to simulate making a docked panel not draggable.
774 panel->set_has_temporary_layout(true);
774 Panel* panel2 = CreatePanel("panel2"); 775 Panel* panel2 = CreatePanel("panel2");
775 776
776 scoped_ptr<NativePanelTesting> panel_testing( 777 scoped_ptr<NativePanelTesting> panel_testing(
777 NativePanelTesting::Create(panel->native_panel())); 778 NativePanelTesting::Create(panel->native_panel()));
778 gfx::Rect bounds = panel->GetBounds(); 779 gfx::Rect bounds = panel->GetBounds();
779 panel_testing->PressLeftMouseButtonTitlebar(bounds.origin()); 780 panel_testing->PressLeftMouseButtonTitlebar(bounds.origin());
780 EXPECT_EQ(bounds.x(), panel->GetBounds().x()); 781 EXPECT_EQ(bounds.x(), panel->GetBounds().x());
781 panel_testing->DragTitlebar(-50, 10); 782 panel_testing->DragTitlebar(-50, 10);
782 EXPECT_EQ(bounds.x(), panel->GetBounds().x()); 783 EXPECT_EQ(bounds.x(), panel->GetBounds().x());
783 panel_testing->FinishDragTitlebar(); 784 panel_testing->FinishDragTitlebar();
784 EXPECT_EQ(bounds.x(), panel->GetBounds().x()); 785 EXPECT_EQ(bounds.x(), panel->GetBounds().x());
785 786
787 // Reset the simulation hack so that the panel can be closed correctly.
788 panel->set_has_temporary_layout(false);
786 panel->Close(); 789 panel->Close();
787 panel2->Close(); 790 panel2->Close();
788 } 791 }
789 792
790 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, CreateSettingsMenu) { 793 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, CreateSettingsMenu) {
791 TestCreateSettingsMenuForExtension( 794 TestCreateSettingsMenuForExtension(
792 FILE_PATH_LITERAL("extension1"), Extension::EXTERNAL_POLICY_DOWNLOAD, 795 FILE_PATH_LITERAL("extension1"), Extension::EXTERNAL_POLICY_DOWNLOAD,
793 "", ""); 796 "", "");
794 TestCreateSettingsMenuForExtension( 797 TestCreateSettingsMenuForExtension(
795 FILE_PATH_LITERAL("extension2"), Extension::INVALID, 798 FILE_PATH_LITERAL("extension2"), Extension::INVALID,
(...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after
1999 // position when tall panel brings up its titlebar. 2002 // position when tall panel brings up its titlebar.
2000 CloseWindowAndWait(panel1->browser()); 2003 CloseWindowAndWait(panel1->browser());
2001 EXPECT_EQ(balloon_bottom_after_tall_panel_titlebar_up, 2004 EXPECT_EQ(balloon_bottom_after_tall_panel_titlebar_up,
2002 GetBalloonBottomPosition(balloon)); 2005 GetBalloonBottomPosition(balloon));
2003 2006
2004 // Closing the remaining tall panel should move the notification balloon back 2007 // Closing the remaining tall panel should move the notification balloon back
2005 // to its original position. 2008 // to its original position.
2006 CloseWindowAndWait(panel2->browser()); 2009 CloseWindowAndWait(panel2->browser());
2007 EXPECT_EQ(original_balloon_bottom, GetBalloonBottomPosition(balloon)); 2010 EXPECT_EQ(original_balloon_bottom, GetBalloonBottomPosition(balloon));
2008 } 2011 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698