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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/i18n/time_formatting.h" | 6 #include "base/i18n/time_formatting.h" |
7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/browser_window.h" | 10 #include "chrome/browser/ui/browser_window.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 for (size_t i = 0; i < num_browser_views; ++i) | 108 for (size_t i = 0; i < num_browser_views; ++i) |
109 initial_bounds[i] = browser_views[i]->panel()->GetRestoredBounds(); | 109 initial_bounds[i] = browser_views[i]->panel()->GetRestoredBounds(); |
110 | 110 |
111 // Trigger the mouse-pressed event. | 111 // Trigger the mouse-pressed event. |
112 // All panels should remain in their original positions. | 112 // All panels should remain in their original positions. |
113 views::MouseEvent pressed(ui::ET_MOUSE_PRESSED, | 113 views::MouseEvent pressed(ui::ET_MOUSE_PRESSED, |
114 initial_bounds[index_to_drag].x(), | 114 initial_bounds[index_to_drag].x(), |
115 initial_bounds[index_to_drag].y(), | 115 initial_bounds[index_to_drag].y(), |
116 ui::EF_LEFT_BUTTON_DOWN); | 116 ui::EF_LEFT_BUTTON_DOWN); |
117 browser_views[index_to_drag]->OnTitleBarMousePressed(pressed); | 117 browser_views[index_to_drag]->OnTitleBarMousePressed(pressed); |
118 gfx::Rect bounds_after_press = | |
119 browser_views[index_to_drag]->panel()->GetRestoredBounds(); | |
120 for (size_t i = 0; i < num_browser_views; ++i) { | 118 for (size_t i = 0; i < num_browser_views; ++i) { |
121 EXPECT_EQ(initial_bounds[i], | 119 EXPECT_EQ(initial_bounds[i], |
122 browser_views[i]->panel()->GetRestoredBounds()); | 120 browser_views[i]->panel()->GetRestoredBounds()); |
123 } | 121 } |
124 | 122 |
125 // Trigger the mouse_dragged event if delta_x or delta_y is not 0. | 123 // Trigger the mouse_dragged event if delta_x or delta_y is not 0. |
126 views::MouseEvent dragged(ui::ET_MOUSE_DRAGGED, | 124 views::MouseEvent dragged(ui::ET_MOUSE_DRAGGED, |
127 initial_bounds[index_to_drag].x() + delta_x, | 125 initial_bounds[index_to_drag].x() + delta_x, |
128 initial_bounds[index_to_drag].y() + delta_y, | 126 initial_bounds[index_to_drag].y() + delta_y, |
129 ui::EF_LEFT_BUTTON_DOWN); | 127 ui::EF_LEFT_BUTTON_DOWN); |
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 } | 750 } |
753 | 751 |
754 IN_PROC_BROWSER_TEST_F(PanelBrowserViewTest, MinimizeAndRestore) { | 752 IN_PROC_BROWSER_TEST_F(PanelBrowserViewTest, MinimizeAndRestore) { |
755 TestMinimizeAndRestore(); | 753 TestMinimizeAndRestore(); |
756 } | 754 } |
757 | 755 |
758 IN_PROC_BROWSER_TEST_F(PanelBrowserViewTest, DrawAttention) { | 756 IN_PROC_BROWSER_TEST_F(PanelBrowserViewTest, DrawAttention) { |
759 TestDrawAttention(); | 757 TestDrawAttention(); |
760 } | 758 } |
761 #endif | 759 #endif |
OLD | NEW |