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/base_panel_browser_test.h" | 6 #include "chrome/browser/ui/panels/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 "content/public/browser/notification_service.h" | 12 #include "content/public/browser/notification_service.h" |
13 #include "content/public/test/test_utils.h" | 13 #include "content/public/test/test_utils.h" |
14 | 14 |
15 // Refactor has only been done for Win and Mac panels so far. | |
16 #if defined(OS_WIN) || defined(OS_MACOSX) | |
17 | |
18 class DockedPanelBrowserTest : public BasePanelBrowserTest { | 15 class DockedPanelBrowserTest : public BasePanelBrowserTest { |
19 public: | 16 public: |
20 virtual void SetUpOnMainThread() OVERRIDE { | 17 virtual void SetUpOnMainThread() OVERRIDE { |
21 BasePanelBrowserTest::SetUpOnMainThread(); | 18 BasePanelBrowserTest::SetUpOnMainThread(); |
22 | 19 |
23 // 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 |
24 // primary monitor. Do the check now. | 21 // primary monitor. Do the check now. |
25 gfx::Rect primary_screen_area = PanelManager::GetInstance()-> | 22 gfx::Rect primary_screen_area = PanelManager::GetInstance()-> |
26 display_settings_provider()->GetPrimaryScreenArea(); | 23 display_settings_provider()->GetPrimaryScreenArea(); |
27 DCHECK(primary_screen_area.width() == 800); | 24 DCHECK(primary_screen_area.width() == 800); |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 // Wait for all processing to finish. | 259 // Wait for all processing to finish. |
263 MessageLoopForUI::current()->RunAllPending(); | 260 MessageLoopForUI::current()->RunAllPending(); |
264 | 261 |
265 // We should not have squeezing any more; all panels should be at full width. | 262 // We should not have squeezing any more; all panels should be at full width. |
266 EXPECT_EQ(panel1->GetBounds().width(), panel1->GetRestoredBounds().width()); | 263 EXPECT_EQ(panel1->GetBounds().width(), panel1->GetRestoredBounds().width()); |
267 EXPECT_EQ(panel4->GetBounds().width(), panel4->GetRestoredBounds().width()); | 264 EXPECT_EQ(panel4->GetBounds().width(), panel4->GetRestoredBounds().width()); |
268 EXPECT_EQ(panel6->GetBounds().width(), panel6->GetRestoredBounds().width()); | 265 EXPECT_EQ(panel6->GetBounds().width(), panel6->GetRestoredBounds().width()); |
269 | 266 |
270 panel_manager->CloseAll(); | 267 panel_manager->CloseAll(); |
271 } | 268 } |
272 | |
273 #endif // OS_WIN || OS_MACOSX | |
OLD | NEW |