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 "chrome/browser/ui/panels/base_panel_browser_test.h" | 5 #include "chrome/browser/ui/panels/base_panel_browser_test.h" |
6 | 6 |
7 #include "chrome/browser/ui/browser_list.h" | 7 #include "chrome/browser/ui/browser_list.h" |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 NativePanelTesting::Create(panel->native_panel())); | 254 NativePanelTesting::Create(panel->native_panel())); |
255 ui_test_utils::WindowedNotificationObserver signal( | 255 ui_test_utils::WindowedNotificationObserver signal( |
256 chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, | 256 chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, |
257 content::Source<Panel>(panel)); | 257 content::Source<Panel>(panel)); |
258 if (!panel_testing->IsAnimatingBounds()) | 258 if (!panel_testing->IsAnimatingBounds()) |
259 return; | 259 return; |
260 signal.Wait(); | 260 signal.Wait(); |
261 EXPECT_TRUE(!panel_testing->IsAnimatingBounds()); | 261 EXPECT_TRUE(!panel_testing->IsAnimatingBounds()); |
262 } | 262 } |
263 | 263 |
| 264 void BasePanelBrowserTest::WaitForStripOwnerChanged( |
| 265 Panel* panel, Panel::StripOwner strip_owner) { |
| 266 ui_test_utils::WindowedNotificationObserver signal( |
| 267 chrome::NOTIFICATION_PANEL_CHANGED_STRIP_OWNER, |
| 268 content::Source<Panel>(panel)); |
| 269 if (panel->strip_owner() == strip_owner) |
| 270 return; |
| 271 signal.Wait(); |
| 272 EXPECT_EQ(strip_owner, panel->strip_owner()); |
| 273 } |
| 274 |
264 void BasePanelBrowserTest::WaitForExpansionStateChanged( | 275 void BasePanelBrowserTest::WaitForExpansionStateChanged( |
265 Panel* panel, Panel::ExpansionState expansion_state) { | 276 Panel* panel, Panel::ExpansionState expansion_state) { |
266 ui_test_utils::WindowedNotificationObserver signal( | 277 ui_test_utils::WindowedNotificationObserver signal( |
267 chrome::NOTIFICATION_PANEL_CHANGED_EXPANSION_STATE, | 278 chrome::NOTIFICATION_PANEL_CHANGED_EXPANSION_STATE, |
268 content::Source<Panel>(panel)); | 279 content::Source<Panel>(panel)); |
269 if (panel->expansion_state() == expansion_state) | 280 if (panel->expansion_state() == expansion_state) |
270 return; | 281 return; |
271 signal.Wait(); | 282 signal.Wait(); |
272 EXPECT_EQ(expansion_state, panel->expansion_state()); | 283 EXPECT_EQ(expansion_state, panel->expansion_state()); |
273 } | 284 } |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 } | 415 } |
405 | 416 |
406 void BasePanelBrowserTest::MoveMouse(const gfx::Point& position) { | 417 void BasePanelBrowserTest::MoveMouse(const gfx::Point& position) { |
407 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position); | 418 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position); |
408 } | 419 } |
409 | 420 |
410 std::string BasePanelBrowserTest::MakePanelName(int index) { | 421 std::string BasePanelBrowserTest::MakePanelName(int index) { |
411 std::string panel_name("Panel"); | 422 std::string panel_name("Panel"); |
412 return panel_name + base::IntToString(index); | 423 return panel_name + base::IntToString(index); |
413 } | 424 } |
OLD | NEW |