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

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

Issue 9560002: Cleanup to keep panel from manipulating its panel strip assignment directly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 <vector> 5 #include <vector>
6 #include "chrome/browser/ui/browser.h" 6 #include "chrome/browser/ui/browser.h"
7 #include "chrome/browser/ui/panels/base_panel_browser_test.h" 7 #include "chrome/browser/ui/panels/base_panel_browser_test.h"
8 #include "chrome/browser/ui/panels/docked_panel_strip.h" 8 #include "chrome/browser/ui/panels/docked_panel_strip.h"
9 #include "chrome/browser/ui/panels/native_panel.h" 9 #include "chrome/browser/ui/panels/native_panel.h"
10 #include "chrome/browser/ui/panels/overflow_panel_strip.h" 10 #include "chrome/browser/ui/panels/overflow_panel_strip.h"
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 EXPECT_FALSE(panel4->has_temporary_layout()); 247 EXPECT_FALSE(panel4->has_temporary_layout());
248 EXPECT_FALSE(panel4->draggable()); 248 EXPECT_FALSE(panel4->draggable());
249 249
250 PanelManager::GetInstance()->CloseAll(); 250 PanelManager::GetInstance()->CloseAll();
251 } 251 }
252 252
253 IN_PROC_BROWSER_TEST_F(PanelOverflowBrowserTest, UpdateDraggableStatus) { 253 IN_PROC_BROWSER_TEST_F(PanelOverflowBrowserTest, UpdateDraggableStatus) {
254 PanelManager* panel_manager = PanelManager::GetInstance(); 254 PanelManager* panel_manager = PanelManager::GetInstance();
255 Panel* panel = CreatePanel("panel"); 255 Panel* panel = CreatePanel("panel");
256 EXPECT_TRUE(panel->draggable()); 256 EXPECT_TRUE(panel->draggable());
257 panel->MoveToStrip(panel_manager->overflow_strip()); 257 panel_manager->ChangePanelLayout(panel, PanelStrip::IN_OVERFLOW);
258 EXPECT_FALSE(panel->draggable()); 258 EXPECT_FALSE(panel->draggable());
259 panel->MoveToStrip(panel_manager->docked_strip()); 259 panel_manager->ChangePanelLayout(panel, PanelStrip::DOCKED);
260 EXPECT_TRUE(panel->draggable()); 260 EXPECT_TRUE(panel->draggable());
261 panel->Close(); 261 panel->Close();
262 } 262 }
263 263
264 // http://crbug.com/115619 264 // http://crbug.com/115619
265 #if defined(OS_WIN) || defined(OS_MACOSX) 265 #if defined(OS_WIN) || defined(OS_MACOSX)
266 #define MAYBE_CreateOverflowPanels CreateOverflowPanels 266 #define MAYBE_CreateOverflowPanels CreateOverflowPanels
267 #else 267 #else
268 #define MAYBE_CreateOverflowPanels DISABLED_CreateOverflowPanels 268 #define MAYBE_CreateOverflowPanels DISABLED_CreateOverflowPanels
269 #endif 269 #endif
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 EXPECT_EQ(2, docked_strip->num_panels()); 642 EXPECT_EQ(2, docked_strip->num_panels());
643 EXPECT_EQ(1, docked_strip->num_temporary_layout_panels()); 643 EXPECT_EQ(1, docked_strip->num_temporary_layout_panels());
644 EXPECT_TRUE(overflow_panel->has_temporary_layout()); 644 EXPECT_TRUE(overflow_panel->has_temporary_layout());
645 645
646 // Close one of the non-overflow panels. Expect the delayed overflow 646 // Close one of the non-overflow panels. Expect the delayed overflow
647 // panel will not be affected by the close. 647 // panel will not be affected by the close.
648 // Hack. Pretend to close panel by removing it directly. Cannot use 648 // Hack. Pretend to close panel by removing it directly. Cannot use
649 // CloseWindowAndWait() here because it will allow the delayed overflow 649 // CloseWindowAndWait() here because it will allow the delayed overflow
650 // to complete. 650 // to complete.
651 docked_strip->RemovePanel(panel1); 651 docked_strip->RemovePanel(panel1);
652 panel1->SetPanelStrip(NULL);
Andrei 2012/03/01 00:08:50 That would nto be needed if RemovePanel() set it t
jennb 2012/03/01 00:30:58 Agree. This is the test that led me to try setting
652 EXPECT_EQ(1, docked_strip->num_panels()); 653 EXPECT_EQ(1, docked_strip->num_panels());
653 EXPECT_EQ(1, docked_strip->num_temporary_layout_panels()); 654 EXPECT_EQ(1, docked_strip->num_temporary_layout_panels());
654 EXPECT_TRUE(overflow_panel->has_temporary_layout()); 655 EXPECT_TRUE(overflow_panel->has_temporary_layout());
655 656
656 // Make sure the overflow panel actually moves to overflow. 657 // Make sure the overflow panel actually moves to overflow.
657 WaitForLayoutModeChanged(overflow_panel, PanelStrip::IN_OVERFLOW); 658 WaitForLayoutModeChanged(overflow_panel, PanelStrip::IN_OVERFLOW);
658 EXPECT_EQ(0, docked_strip->num_temporary_layout_panels()); 659 EXPECT_EQ(0, docked_strip->num_temporary_layout_panels());
659 660
660 // Hack. Put the "falsely closed" panel back into the panel strip 661 // Hack. Put the "falsely closed" panel back into the panel strip
661 // so we can properly close it to wrap up this test. 662 // so we can properly close it to wrap up this test.
(...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after
1650 // End full screen mode, expansion occurs again. 1651 // End full screen mode, expansion occurs again.
1651 overflow_strip->OnFullScreenModeChanged(false); 1652 overflow_strip->OnFullScreenModeChanged(false);
1652 EXPECT_TRUE(panel_manager->mouse_watcher()->IsActive()); 1653 EXPECT_TRUE(panel_manager->mouse_watcher()->IsActive());
1653 MoveMouse(in_overflow_area); 1654 MoveMouse(in_overflow_area);
1654 EXPECT_GT(overflow_strip->current_display_width(), iconified_width); 1655 EXPECT_GT(overflow_strip->current_display_width(), iconified_width);
1655 MoveMouse(beyond_overflow_area); 1656 MoveMouse(beyond_overflow_area);
1656 EXPECT_EQ(iconified_width, overflow_strip->current_display_width()); 1657 EXPECT_EQ(iconified_width, overflow_strip->current_display_width());
1657 1658
1658 panel_manager->CloseAll(); 1659 panel_manager->CloseAll();
1659 } 1660 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698