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

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

Issue 9546001: Support detaching/attaching panels via inter-strip drags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More fix per feedback Created 8 years, 9 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 "chrome/browser/ui/panels/base_panel_browser_test.h" 5 #include "chrome/browser/ui/panels/base_panel_browser_test.h"
6 #include "chrome/browser/ui/panels/detached_panel_strip.h" 6 #include "chrome/browser/ui/panels/detached_panel_strip.h"
7 #include "chrome/browser/ui/panels/native_panel.h" 7 #include "chrome/browser/ui/panels/native_panel.h"
8 #include "chrome/browser/ui/panels/panel.h" 8 #include "chrome/browser/ui/panels/panel.h"
9 #include "chrome/browser/ui/panels/panel_drag_controller.h" 9 #include "chrome/browser/ui/panels/panel_drag_controller.h"
10 #include "chrome/browser/ui/panels/panel_manager.h" 10 #include "chrome/browser/ui/panels/panel_manager.h"
(...skipping 29 matching lines...) Expand all
40 panel_manager->CloseAll(); 40 panel_manager->CloseAll();
41 } 41 }
42 42
43 IN_PROC_BROWSER_TEST_F(DetachedPanelBrowserTest, DragDetachedPanel) { 43 IN_PROC_BROWSER_TEST_F(DetachedPanelBrowserTest, DragDetachedPanel) {
44 PanelManager* panel_manager = PanelManager::GetInstance(); 44 PanelManager* panel_manager = PanelManager::GetInstance();
45 45
46 // Create one detached panel. 46 // Create one detached panel.
47 Panel* panel = CreatePanelWithBounds("Panel1", gfx::Rect(0, 0, 250, 200)); 47 Panel* panel = CreatePanelWithBounds("Panel1", gfx::Rect(0, 0, 250, 200));
48 panel_manager->MovePanelToStrip(panel, PanelStrip::DETACHED); 48 panel_manager->MovePanelToStrip(panel, PanelStrip::DETACHED);
49 49
50 // Test that the detached panel can be dragged anywhere. 50 // Test that the detached panel can be dragged almost anywhere except getting
51 // close to the bottom of the docked area to trigger the attach.
51 scoped_ptr<NativePanelTesting> panel_testing( 52 scoped_ptr<NativePanelTesting> panel_testing(
52 NativePanelTesting::Create(panel->native_panel())); 53 NativePanelTesting::Create(panel->native_panel()));
53 gfx::Point origin = panel->GetBounds().origin(); 54 gfx::Point origin = panel->GetBounds().origin();
54 55
55 panel_testing->PressLeftMouseButtonTitlebar(origin); 56 panel_testing->PressLeftMouseButtonTitlebar(origin);
56 EXPECT_EQ(origin, panel->GetBounds().origin()); 57 EXPECT_EQ(origin, panel->GetBounds().origin());
57 58
58 origin.Offset(-51, -102); 59 origin.Offset(-51, -102);
59 panel_testing->DragTitlebar(origin); 60 panel_testing->DragTitlebar(origin);
60 EXPECT_EQ(origin, panel->GetBounds().origin()); 61 EXPECT_EQ(origin, panel->GetBounds().origin());
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 CloseWindowAndWait(panel1->browser()); 224 CloseWindowAndWait(panel1->browser());
224 EXPECT_FALSE(drag_controller->IsDragging()); 225 EXPECT_FALSE(drag_controller->IsDragging());
225 226
226 ASSERT_EQ(1, detached_strip->num_panels()); 227 ASSERT_EQ(1, detached_strip->num_panels());
227 EXPECT_TRUE(detached_strip->HasPanel(panel4)); 228 EXPECT_TRUE(detached_strip->HasPanel(panel4));
228 EXPECT_EQ(panel4_position, panel4->GetBounds().origin()); 229 EXPECT_EQ(panel4_position, panel4->GetBounds().origin());
229 } 230 }
230 231
231 panel_manager->CloseAll(); 232 panel_manager->CloseAll();
232 } 233 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/panels/detached_panel_strip.h » ('j') | chrome/browser/ui/panels/docked_panel_strip.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698