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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
8 #include "chrome/browser/download/download_service.h" | 8 #include "chrome/browser/download/download_service.h" |
9 #include "chrome/browser/download/download_service_factory.h" | 9 #include "chrome/browser/download/download_service_factory.h" |
10 #include "chrome/browser/net/url_request_mock_util.h" | 10 #include "chrome/browser/net/url_request_mock_util.h" |
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
961 | 961 |
962 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, MinimizeRestore) { | 962 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, MinimizeRestore) { |
963 // We'll simulate mouse movements for test. | 963 // We'll simulate mouse movements for test. |
964 PanelMouseWatcher* mouse_watcher = new TestPanelMouseWatcher(); | 964 PanelMouseWatcher* mouse_watcher = new TestPanelMouseWatcher(); |
965 PanelManager::GetInstance()->SetMouseWatcherForTesting(mouse_watcher); | 965 PanelManager::GetInstance()->SetMouseWatcherForTesting(mouse_watcher); |
966 | 966 |
967 // Test with one panel. | 967 // Test with one panel. |
968 CreatePanelWithBounds("PanelTest1", gfx::Rect(0, 0, 100, 100)); | 968 CreatePanelWithBounds("PanelTest1", gfx::Rect(0, 0, 100, 100)); |
969 TestMinimizeRestore(); | 969 TestMinimizeRestore(); |
970 | 970 |
971 PanelManager::GetInstance()->RemoveAll(); | 971 PanelManager::GetInstance()->CloseAll(); |
972 } | 972 } |
973 | 973 |
974 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, MinimizeRestoreTwoPanels) { | 974 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, MinimizeRestoreTwoPanels) { |
975 // We'll simulate mouse movements for test. | 975 // We'll simulate mouse movements for test. |
976 PanelMouseWatcher* mouse_watcher = new TestPanelMouseWatcher(); | 976 PanelMouseWatcher* mouse_watcher = new TestPanelMouseWatcher(); |
977 PanelManager::GetInstance()->SetMouseWatcherForTesting(mouse_watcher); | 977 PanelManager::GetInstance()->SetMouseWatcherForTesting(mouse_watcher); |
978 | 978 |
979 // Test with two panels. | 979 // Test with two panels. |
980 CreatePanelWithBounds("PanelTest1", gfx::Rect(0, 0, 100, 100)); | 980 CreatePanelWithBounds("PanelTest1", gfx::Rect(0, 0, 100, 100)); |
981 CreatePanelWithBounds("PanelTest2", gfx::Rect(0, 0, 110, 110)); | 981 CreatePanelWithBounds("PanelTest2", gfx::Rect(0, 0, 110, 110)); |
982 TestMinimizeRestore(); | 982 TestMinimizeRestore(); |
983 | 983 |
984 PanelManager::GetInstance()->RemoveAll(); | 984 PanelManager::GetInstance()->CloseAll(); |
985 } | 985 } |
986 | 986 |
987 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, MinimizeRestoreThreePanels) { | 987 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, MinimizeRestoreThreePanels) { |
988 // We'll simulate mouse movements for test. | 988 // We'll simulate mouse movements for test. |
989 PanelMouseWatcher* mouse_watcher = new TestPanelMouseWatcher(); | 989 PanelMouseWatcher* mouse_watcher = new TestPanelMouseWatcher(); |
990 PanelManager::GetInstance()->SetMouseWatcherForTesting(mouse_watcher); | 990 PanelManager::GetInstance()->SetMouseWatcherForTesting(mouse_watcher); |
991 | 991 |
992 // Test with three panels. | 992 // Test with three panels. |
993 CreatePanelWithBounds("PanelTest1", gfx::Rect(0, 0, 100, 100)); | 993 CreatePanelWithBounds("PanelTest1", gfx::Rect(0, 0, 100, 100)); |
994 CreatePanelWithBounds("PanelTest2", gfx::Rect(0, 0, 110, 110)); | 994 CreatePanelWithBounds("PanelTest2", gfx::Rect(0, 0, 110, 110)); |
995 CreatePanelWithBounds("PanelTest3", gfx::Rect(0, 0, 120, 120)); | 995 CreatePanelWithBounds("PanelTest3", gfx::Rect(0, 0, 120, 120)); |
996 TestMinimizeRestore(); | 996 TestMinimizeRestore(); |
997 | 997 |
998 PanelManager::GetInstance()->RemoveAll(); | 998 PanelManager::GetInstance()->CloseAll(); |
999 } | 999 } |
1000 | 1000 |
1001 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, ActivatePanelOrTabbedWindow) { | 1001 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, ActivatePanelOrTabbedWindow) { |
1002 CreatePanelParams params1("Panel1", gfx::Rect(), SHOW_AS_ACTIVE); | 1002 CreatePanelParams params1("Panel1", gfx::Rect(), SHOW_AS_ACTIVE); |
1003 Panel* panel1 = CreatePanelWithParams(params1); | 1003 Panel* panel1 = CreatePanelWithParams(params1); |
1004 CreatePanelParams params2("Panel2", gfx::Rect(), SHOW_AS_ACTIVE); | 1004 CreatePanelParams params2("Panel2", gfx::Rect(), SHOW_AS_ACTIVE); |
1005 Panel* panel2 = CreatePanelWithParams(params2); | 1005 Panel* panel2 = CreatePanelWithParams(params2); |
1006 // Need tab contents in order to trigger deactivation upon close. | 1006 // Need tab contents in order to trigger deactivation upon close. |
1007 CreateTestTabContents(panel2->browser()); | 1007 CreateTestTabContents(panel2->browser()); |
1008 | 1008 |
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1993 // position when tall panel brings up its titlebar. | 1993 // position when tall panel brings up its titlebar. |
1994 CloseWindowAndWait(panel1->browser()); | 1994 CloseWindowAndWait(panel1->browser()); |
1995 EXPECT_EQ(balloon_bottom_after_tall_panel_titlebar_up, | 1995 EXPECT_EQ(balloon_bottom_after_tall_panel_titlebar_up, |
1996 GetBalloonBottomPosition(balloon)); | 1996 GetBalloonBottomPosition(balloon)); |
1997 | 1997 |
1998 // Closing the remaining tall panel should move the notification balloon back | 1998 // Closing the remaining tall panel should move the notification balloon back |
1999 // to its original position. | 1999 // to its original position. |
2000 CloseWindowAndWait(panel2->browser()); | 2000 CloseWindowAndWait(panel2->browser()); |
2001 EXPECT_EQ(original_balloon_bottom, GetBalloonBottomPosition(balloon)); | 2001 EXPECT_EQ(original_balloon_bottom, GetBalloonBottomPosition(balloon)); |
2002 } | 2002 } |
OLD | NEW |