| 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 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 MessageLoop::current()->RunAllPending(); | 820 MessageLoop::current()->RunAllPending(); |
| 821 } | 821 } |
| 822 EXPECT_LT(bounds_on_shrink.width(), bounds_on_grow.width()); | 822 EXPECT_LT(bounds_on_shrink.width(), bounds_on_grow.width()); |
| 823 EXPECT_GT(bounds_on_shrink.width(), initial_bounds.width()); | 823 EXPECT_GT(bounds_on_shrink.width(), initial_bounds.width()); |
| 824 EXPECT_EQ(bounds_on_shrink.height(), initial_bounds.height()); | 824 EXPECT_EQ(bounds_on_shrink.height(), initial_bounds.height()); |
| 825 | 825 |
| 826 panel->Close(); | 826 panel->Close(); |
| 827 } | 827 } |
| 828 #endif | 828 #endif |
| 829 | 829 |
| 830 #if defined(TOOLKIT_GTK) || defined(OS_MACOSX) | 830 // TODO(jennb): Disabling for Windows due to failure on XP and Vista. |
| 831 #if defined(OS_WIN) |
| 832 #define MAYBE_MinimizeRestore DISABLED_MinimizeRestore |
| 833 #else |
| 831 #define MAYBE_MinimizeRestore MinimizeRestore | 834 #define MAYBE_MinimizeRestore MinimizeRestore |
| 832 #else | |
| 833 #define MAYBE_MinimizeRestore DISABLED_MinimizeRestore | |
| 834 #endif | 835 #endif |
| 835 | |
| 836 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, MAYBE_MinimizeRestore) { | 836 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, MAYBE_MinimizeRestore) { |
| 837 // Disable mouse watcher. We'll simulate mouse movements for test. | 837 // Disable mouse watcher. We'll simulate mouse movements for test. |
| 838 NativePanelTesting::GetPanelMouseWatcherInstance()->EnableTestingMode(); | 838 NativePanelTesting::GetPanelMouseWatcherInstance()->EnableTestingMode(); |
| 839 | 839 |
| 840 // Test with one panel. | 840 // Test with one panel. |
| 841 CreatePanelWithBounds("PanelTest1", gfx::Rect(0, 0, 100, 100)); | 841 CreatePanelWithBounds("PanelTest1", gfx::Rect(0, 0, 100, 100)); |
| 842 TestMinimizeRestore(); | 842 TestMinimizeRestore(); |
| 843 | 843 |
| 844 // Test with two panels. | 844 // Test with two panels. |
| 845 CreatePanelWithBounds("PanelTest2", gfx::Rect(0, 0, 110, 110)); | 845 CreatePanelWithBounds("PanelTest2", gfx::Rect(0, 0, 110, 110)); |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1018 EXPECT_EQ(1, tabbed_browser->tab_count()); | 1018 EXPECT_EQ(1, tabbed_browser->tab_count()); |
| 1019 ASSERT_TRUE(tabbed_browser->window()->IsDownloadShelfVisible()); | 1019 ASSERT_TRUE(tabbed_browser->window()->IsDownloadShelfVisible()); |
| 1020 tabbed_browser->CloseWindow(); | 1020 tabbed_browser->CloseWindow(); |
| 1021 #endif | 1021 #endif |
| 1022 | 1022 |
| 1023 EXPECT_EQ(1, panel_browser->tab_count()); | 1023 EXPECT_EQ(1, panel_browser->tab_count()); |
| 1024 ASSERT_FALSE(panel_browser->window()->IsDownloadShelfVisible()); | 1024 ASSERT_FALSE(panel_browser->window()->IsDownloadShelfVisible()); |
| 1025 | 1025 |
| 1026 panel_browser->CloseWindow(); | 1026 panel_browser->CloseWindow(); |
| 1027 } | 1027 } |
| OLD | NEW |