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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 // environment, may actually depend on the autorelease pool being recycled | 465 // environment, may actually depend on the autorelease pool being recycled |
466 // with the run loop in order to perform important work. Replicate this in | 466 // with the run loop in order to perform important work. Replicate this in |
467 // the test environment. | 467 // the test environment. |
468 AutoreleasePool()->Recycle(); | 468 AutoreleasePool()->Recycle(); |
469 | 469 |
470 // Make sure that everything has a chance to run. | 470 // Make sure that everything has a chance to run. |
471 chrome::testing::NSRunLoopRunAllPending(); | 471 chrome::testing::NSRunLoopRunAllPending(); |
472 #endif // OS_MACOSX | 472 #endif // OS_MACOSX |
473 } | 473 } |
474 | 474 |
| 475 void BasePanelBrowserTest::MoveMouseAndWaitForExpansionStateChange( |
| 476 Panel* panel, |
| 477 const gfx::Point& position) { |
| 478 ui_test_utils::WindowedNotificationObserver signal( |
| 479 chrome::NOTIFICATION_PANEL_CHANGED_EXPANSION_STATE, |
| 480 content::Source<Panel>(panel)); |
| 481 MoveMouse(position); |
| 482 signal.Wait(); |
| 483 } |
| 484 |
475 void BasePanelBrowserTest::MoveMouse(const gfx::Point& position) { | 485 void BasePanelBrowserTest::MoveMouse(const gfx::Point& position) { |
476 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position); | 486 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position); |
477 } | 487 } |
478 | 488 |
479 std::string BasePanelBrowserTest::MakePanelName(int index) { | 489 std::string BasePanelBrowserTest::MakePanelName(int index) { |
480 std::string panel_name("Panel"); | 490 std::string panel_name("Panel"); |
481 return panel_name + base::IntToString(index); | 491 return panel_name + base::IntToString(index); |
482 } | 492 } |
OLD | NEW |