| OLD | NEW |
| 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/message_loop.h" | 5 #include "base/message_loop.h" |
| 6 #include "chrome/browser/ui/panels/old_base_panel_browser_test.h" | 6 #include "chrome/browser/ui/panels/old_base_panel_browser_test.h" |
| 7 #include "chrome/browser/ui/panels/docked_panel_strip.h" | 7 #include "chrome/browser/ui/panels/docked_panel_strip.h" |
| 8 #include "chrome/browser/ui/panels/panel.h" | 8 #include "chrome/browser/ui/panels/panel.h" |
| 9 #include "chrome/browser/ui/panels/panel_manager.h" | 9 #include "chrome/browser/ui/panels/panel_manager.h" |
| 10 #include "chrome/browser/ui/panels/test_panel_mouse_watcher.h" | 10 #include "chrome/browser/ui/panels/test_panel_mouse_watcher.h" |
| 11 #include "chrome/common/chrome_notification_types.h" | 11 #include "chrome/common/chrome_notification_types.h" |
| 12 #include "chrome/test/base/ui_test_utils.h" | |
| 13 #include "content/public/browser/notification_service.h" | 12 #include "content/public/browser/notification_service.h" |
| 13 #include "content/public/test/test_utils.h" |
| 14 | 14 |
| 15 class OldDockedPanelBrowserTest : public OldBasePanelBrowserTest { | 15 class OldDockedPanelBrowserTest : public OldBasePanelBrowserTest { |
| 16 public: | 16 public: |
| 17 virtual void SetUpOnMainThread() OVERRIDE { | 17 virtual void SetUpOnMainThread() OVERRIDE { |
| 18 OldBasePanelBrowserTest::SetUpOnMainThread(); | 18 OldBasePanelBrowserTest::SetUpOnMainThread(); |
| 19 | 19 |
| 20 // All the tests here assume using mocked 800x600 screen area for the | 20 // All the tests here assume using mocked 800x600 screen area for the |
| 21 // primary monitor. Do the check now. | 21 // primary monitor. Do the check now. |
| 22 gfx::Rect primary_screen_area = PanelManager::GetInstance()-> | 22 gfx::Rect primary_screen_area = PanelManager::GetInstance()-> |
| 23 display_settings_provider()->GetPrimaryScreenArea(); | 23 display_settings_provider()->GetPrimaryScreenArea(); |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 int width_of_panel3_squeezed = panel3->GetBounds().width(); | 186 int width_of_panel3_squeezed = panel3->GetBounds().width(); |
| 187 panel3->Minimize(); | 187 panel3->Minimize(); |
| 188 | 188 |
| 189 // Wait for any possible events. | 189 // Wait for any possible events. |
| 190 MessageLoopForUI::current()->RunAllPending(); | 190 MessageLoopForUI::current()->RunAllPending(); |
| 191 | 191 |
| 192 // Check that this panel is still at the same width. | 192 // Check that this panel is still at the same width. |
| 193 EXPECT_EQ(width_of_panel3_squeezed, panel3->GetBounds().width()); | 193 EXPECT_EQ(width_of_panel3_squeezed, panel3->GetBounds().width()); |
| 194 | 194 |
| 195 // Minimize the active panel. It should become inactive and shrink in width. | 195 // Minimize the active panel. It should become inactive and shrink in width. |
| 196 ui_test_utils::WindowedNotificationObserver signal( | 196 content::WindowedNotificationObserver signal( |
| 197 chrome::NOTIFICATION_PANEL_STRIP_UPDATED, | 197 chrome::NOTIFICATION_PANEL_STRIP_UPDATED, |
| 198 content::NotificationService::AllSources()); | 198 content::NotificationService::AllSources()); |
| 199 panel7->Minimize(); | 199 panel7->Minimize(); |
| 200 | 200 |
| 201 // Wait for active states to settle. | 201 // Wait for active states to settle. |
| 202 WaitForPanelActiveState(panel7, SHOW_AS_INACTIVE); | 202 WaitForPanelActiveState(panel7, SHOW_AS_INACTIVE); |
| 203 | 203 |
| 204 // Wait for the scheduled layout to run. | 204 // Wait for the scheduled layout to run. |
| 205 signal.Wait(); | 205 signal.Wait(); |
| 206 | 206 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 // Wait for all processing to finish. | 272 // Wait for all processing to finish. |
| 273 MessageLoopForUI::current()->RunAllPending(); | 273 MessageLoopForUI::current()->RunAllPending(); |
| 274 | 274 |
| 275 // We should not have squeezing any more; all panels should be at full width. | 275 // We should not have squeezing any more; all panels should be at full width. |
| 276 EXPECT_EQ(panel1->GetBounds().width(), panel1->GetRestoredBounds().width()); | 276 EXPECT_EQ(panel1->GetBounds().width(), panel1->GetRestoredBounds().width()); |
| 277 EXPECT_EQ(panel4->GetBounds().width(), panel4->GetRestoredBounds().width()); | 277 EXPECT_EQ(panel4->GetBounds().width(), panel4->GetRestoredBounds().width()); |
| 278 EXPECT_EQ(panel6->GetBounds().width(), panel6->GetRestoredBounds().width()); | 278 EXPECT_EQ(panel6->GetBounds().width(), panel6->GetRestoredBounds().width()); |
| 279 | 279 |
| 280 panel_manager->CloseAll(); | 280 panel_manager->CloseAll(); |
| 281 } | 281 } |
| OLD | NEW |