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

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

Issue 9817020: Linux: Fix the build for Ubuntu Precise. (Closed) Base URL: svn://chrome-svn/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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 PanelManager* panel_manager = PanelManager::GetInstance(); 108 PanelManager* panel_manager = PanelManager::GetInstance();
109 panel_manager->overflow_strip()->set_max_visible_panels( 109 panel_manager->overflow_strip()->set_max_visible_panels(
110 kMaxVisibleOverflowPanelsForTesting); 110 kMaxVisibleOverflowPanelsForTesting);
111 panel_manager->overflow_strip()->set_max_visible_panels_on_hover( 111 panel_manager->overflow_strip()->set_max_visible_panels_on_hover(
112 kMaxVisibleOverflowPanelsOnHoverForTesting); 112 kMaxVisibleOverflowPanelsOnHoverForTesting);
113 113
114 PanelMouseWatcher* mouse_watcher = new TestPanelMouseWatcher(); 114 PanelMouseWatcher* mouse_watcher = new TestPanelMouseWatcher();
115 panel_manager->SetMouseWatcherForTesting(mouse_watcher); 115 panel_manager->SetMouseWatcherForTesting(mouse_watcher);
116 116
117 // All the overflow tests assume 800x600 work area. Do the check now. 117 // All the overflow tests assume 800x600 work area. Do the check now.
118 DCHECK(PanelManager::GetInstance()->work_area().width() == 800); 118 DCHECK_EQ(800, PanelManager::GetInstance()->work_area().width());
119 } 119 }
120 120
121 protected: 121 protected:
122 static PanelDataList GetAllDockedPanelData() { 122 static PanelDataList GetAllDockedPanelData() {
123 PanelDataList panel_data_list; 123 PanelDataList panel_data_list;
124 DockedPanelStrip::Panels panels = 124 DockedPanelStrip::Panels panels =
125 PanelManager::GetInstance()->docked_strip()->panels(); 125 PanelManager::GetInstance()->docked_strip()->panels();
126 for (DockedPanelStrip::Panels::const_iterator iter = panels.begin(); 126 for (DockedPanelStrip::Panels::const_iterator iter = panels.begin();
127 iter != panels.end(); ++iter) { 127 iter != panels.end(); ++iter) {
128 Panel* panel = *iter; 128 Panel* panel = *iter;
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 for (; num_panels < num_panels_to_add; ++num_panels) { 381 for (; num_panels < num_panels_to_add; ++num_panels) {
382 Panel* panel = CreatePanelWithParams(params); 382 Panel* panel = CreatePanelWithParams(params);
383 panel->SetExpansionState(Panel::MINIMIZED); 383 panel->SetExpansionState(Panel::MINIMIZED);
384 384
385 panel->panel_strip()->RemovePanel(panel); 385 panel->panel_strip()->RemovePanel(panel);
386 EXPECT_EQ(NULL, panel->panel_strip()); 386 EXPECT_EQ(NULL, panel->panel_strip());
387 panel->set_has_temporary_layout(false); 387 panel->set_has_temporary_layout(false);
388 388
389 docked_strip->AddPanel(panel, PanelStrip::DEFAULT_POSITION); 389 docked_strip->AddPanel(panel, PanelStrip::DEFAULT_POSITION);
390 EXPECT_EQ(Panel::MINIMIZED, panel->expansion_state()); 390 EXPECT_EQ(Panel::MINIMIZED, panel->expansion_state());
391 EXPECT_EQ(false, panel->has_temporary_layout()); 391 EXPECT_FALSE(panel->has_temporary_layout());
392 } 392 }
393 393
394 EXPECT_EQ(num_panels_to_add, num_panels); 394 EXPECT_EQ(num_panels_to_add, num_panels);
395 EXPECT_EQ(0, docked_strip->num_temporary_layout_panels()); 395 EXPECT_EQ(0, docked_strip->num_temporary_layout_panels());
396 EXPECT_EQ(num_panels, static_cast<unsigned int> 396 EXPECT_EQ(num_panels, static_cast<unsigned int>
397 (docked_strip->minimized_panel_count() + 397 (docked_strip->minimized_panel_count() +
398 overflow_strip->num_panels())); 398 overflow_strip->num_panels()));
399 399
400 PanelManager::GetInstance()->CloseAll(); 400 PanelManager::GetInstance()->CloseAll();
401 } 401 }
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 // Compiz refuses to activate an initially inactive window. 958 // Compiz refuses to activate an initially inactive window.
959 if (SkipTestIfIceWM() || SkipTestIfCompizWM()) 959 if (SkipTestIfIceWM() || SkipTestIfCompizWM())
960 return; 960 return;
961 961
962 PanelManager* panel_manager = PanelManager::GetInstance(); 962 PanelManager* panel_manager = PanelManager::GetInstance();
963 963
964 // Create docked and overflow panels. 964 // Create docked and overflow panels.
965 // docked: P0, P1, P2 965 // docked: P0, P1, P2
966 // overflow: P3, P4, P5 966 // overflow: P3, P4, P5
967 const int panel_widths[] = { 967 const int panel_widths[] = {
968 240, 240, 120, // docked 968 240, 240, 120, // docked
969 240, 240, 240 // overflow 969 240, 240, 240 // overflow
970 }; 970 };
971 std::vector<Panel*> panels = CreateOverflowPanels(3, 3, panel_widths); 971 std::vector<Panel*> panels = CreateOverflowPanels(3, 3, panel_widths);
972 972
973 PanelDataList expected_docked_list; 973 PanelDataList expected_docked_list;
974 expected_docked_list.AddDocked(panels[0], Panel::EXPANDED, false); 974 expected_docked_list.AddDocked(panels[0], Panel::EXPANDED, false);
975 expected_docked_list.AddDocked(panels[1], Panel::EXPANDED, false); 975 expected_docked_list.AddDocked(panels[1], Panel::EXPANDED, false);
976 expected_docked_list.AddDocked(panels[2], Panel::EXPANDED, false); 976 expected_docked_list.AddDocked(panels[2], Panel::EXPANDED, false);
977 EXPECT_EQ(expected_docked_list, GetAllDockedPanelData()); 977 EXPECT_EQ(expected_docked_list, GetAllDockedPanelData());
978 978
979 PanelDataList expected_overflow_list; 979 PanelDataList expected_overflow_list;
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
1218 panels[4]->GetBounds().right() + 5, panels[4]->GetBounds().y())); 1218 panels[4]->GetBounds().right() + 5, panels[4]->GetBounds().y()));
1219 EXPECT_EQ(iconified_width, overflow_strip->current_display_width()); 1219 EXPECT_EQ(iconified_width, overflow_strip->current_display_width());
1220 EXPECT_EQ(iconified_width, panels[3]->GetBounds().width()); 1220 EXPECT_EQ(iconified_width, panels[3]->GetBounds().width());
1221 EXPECT_EQ(iconified_width, panels[4]->GetBounds().width()); 1221 EXPECT_EQ(iconified_width, panels[4]->GetBounds().width());
1222 1222
1223 panel_manager->CloseAll(); 1223 panel_manager->CloseAll();
1224 } 1224 }
1225 1225
1226 // http://crbug.com/115568 1226 // http://crbug.com/115568
1227 #if defined(OS_WIN) || defined(OS_MACOSX) 1227 #if defined(OS_WIN) || defined(OS_MACOSX)
1228 #define MAYBE_HoverOverOverflowAreaWithOverflowOfOverflow HoverOverOverflowAreaW ithOverflowOfOverflow 1228 #define MAYBE_HoverOverOverflowAreaWithOverflowOfOverflow \
1229 HoverOverOverflowAreaWithOverflowOfOverflow
1229 #else 1230 #else
1230 #define MAYBE_HoverOverOverflowAreaWithOverflowOfOverflow DISABLED_HoverOverOver flowAreaWithOverflowOfOverflow 1231 #define MAYBE_HoverOverOverflowAreaWithOverflowOfOverflow \
1232 DISABLED_HoverOverOverflowAreaWithOverflowOfOverflow
1231 #endif 1233 #endif
1232 IN_PROC_BROWSER_TEST_F(PanelOverflowBrowserTest, 1234 IN_PROC_BROWSER_TEST_F(PanelOverflowBrowserTest,
1233 MAYBE_HoverOverOverflowAreaWithOverflowOfOverflow) { 1235 MAYBE_HoverOverOverflowAreaWithOverflowOfOverflow) {
1234 PanelManager* panel_manager = PanelManager::GetInstance(); 1236 PanelManager* panel_manager = PanelManager::GetInstance();
1235 OverflowPanelStrip* overflow_strip = 1237 OverflowPanelStrip* overflow_strip =
1236 panel_manager->overflow_strip(); 1238 panel_manager->overflow_strip();
1237 int iconified_width = overflow_strip->current_display_width(); 1239 int iconified_width = overflow_strip->current_display_width();
1238 1240
1239 // Create docked and overflow panels. 1241 // Create docked and overflow panels.
1240 // docked: P0, P1, P2 1242 // docked: P0, P1, P2
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
1701 // End full screen mode, expansion occurs again. 1703 // End full screen mode, expansion occurs again.
1702 overflow_strip->OnFullScreenModeChanged(false); 1704 overflow_strip->OnFullScreenModeChanged(false);
1703 EXPECT_TRUE(panel_manager->mouse_watcher()->IsActive()); 1705 EXPECT_TRUE(panel_manager->mouse_watcher()->IsActive());
1704 MoveMouse(in_overflow_area); 1706 MoveMouse(in_overflow_area);
1705 EXPECT_GT(overflow_strip->current_display_width(), iconified_width); 1707 EXPECT_GT(overflow_strip->current_display_width(), iconified_width);
1706 MoveMouse(beyond_overflow_area); 1708 MoveMouse(beyond_overflow_area);
1707 EXPECT_EQ(iconified_width, overflow_strip->current_display_width()); 1709 EXPECT_EQ(iconified_width, overflow_strip->current_display_width());
1708 1710
1709 panel_manager->CloseAll(); 1711 panel_manager->CloseAll();
1710 } 1712 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698