| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "chrome/browser/net/url_request_mock_util.h" | 6 #include "chrome/browser/net/url_request_mock_util.h" |
| 7 #include "chrome/browser/prefs/pref_service.h" | 7 #include "chrome/browser/prefs/pref_service.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/browser_list.h" | 9 #include "chrome/browser/ui/browser_list.h" |
| 10 #include "chrome/browser/ui/browser_window.h" | 10 #include "chrome/browser/ui/browser_window.h" |
| (...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 817 MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask()); | 817 MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask()); |
| 818 MessageLoop::current()->RunAllPending(); | 818 MessageLoop::current()->RunAllPending(); |
| 819 } | 819 } |
| 820 EXPECT_LT(bounds_on_shrink.width(), bounds_on_grow.width()); | 820 EXPECT_LT(bounds_on_shrink.width(), bounds_on_grow.width()); |
| 821 EXPECT_GT(bounds_on_shrink.width(), initial_bounds.width()); | 821 EXPECT_GT(bounds_on_shrink.width(), initial_bounds.width()); |
| 822 EXPECT_EQ(bounds_on_shrink.height(), initial_bounds.height()); | 822 EXPECT_EQ(bounds_on_shrink.height(), initial_bounds.height()); |
| 823 | 823 |
| 824 panel->Close(); | 824 panel->Close(); |
| 825 } | 825 } |
| 826 | 826 |
| 827 #if defined(TOOLKIT_GTK) || defined(OS_MACOSX) | 827 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, MinimizeRestore) { |
| 828 #define MAYBE_MinimizeRestore MinimizeRestore | |
| 829 #else | |
| 830 #define MAYBE_MinimizeRestore DISABLED_MinimizeRestore | |
| 831 #endif | |
| 832 | |
| 833 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, MAYBE_MinimizeRestore) { | |
| 834 // Disable mouse watcher. We'll simulate mouse movements for test. | 828 // Disable mouse watcher. We'll simulate mouse movements for test. |
| 835 NativePanelTesting::GetPanelMouseWatcherInstance()->EnableTestingMode(); | 829 NativePanelTesting::GetPanelMouseWatcherInstance()->EnableTestingMode(); |
| 836 | 830 |
| 837 // Test with one panel. | 831 // Test with one panel. |
| 838 CreatePanelWithBounds("PanelTest1", gfx::Rect(0, 0, 100, 100)); | 832 CreatePanelWithBounds("PanelTest1", gfx::Rect(0, 0, 100, 100)); |
| 839 TestMinimizeRestore(); | 833 TestMinimizeRestore(); |
| 840 | 834 |
| 841 // Test with two panels. | 835 // Test with two panels. |
| 842 CreatePanelWithBounds("PanelTest2", gfx::Rect(0, 0, 110, 110)); | 836 CreatePanelWithBounds("PanelTest2", gfx::Rect(0, 0, 110, 110)); |
| 843 TestMinimizeRestore(); | 837 TestMinimizeRestore(); |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 EXPECT_EQ(1, tabbed_browser->tab_count()); | 1009 EXPECT_EQ(1, tabbed_browser->tab_count()); |
| 1016 ASSERT_TRUE(tabbed_browser->window()->IsDownloadShelfVisible()); | 1010 ASSERT_TRUE(tabbed_browser->window()->IsDownloadShelfVisible()); |
| 1017 tabbed_browser->CloseWindow(); | 1011 tabbed_browser->CloseWindow(); |
| 1018 #endif | 1012 #endif |
| 1019 | 1013 |
| 1020 EXPECT_EQ(1, panel_browser->tab_count()); | 1014 EXPECT_EQ(1, panel_browser->tab_count()); |
| 1021 ASSERT_FALSE(panel_browser->window()->IsDownloadShelfVisible()); | 1015 ASSERT_FALSE(panel_browser->window()->IsDownloadShelfVisible()); |
| 1022 | 1016 |
| 1023 panel_browser->CloseWindow(); | 1017 panel_browser->CloseWindow(); |
| 1024 } | 1018 } |
| OLD | NEW |