diff options
Diffstat (limited to 'chrome/browser/ui/panels')
10 files changed, 53 insertions, 44 deletions
diff --git a/chrome/browser/ui/panels/base_panel_browser_test.cc b/chrome/browser/ui/panels/base_panel_browser_test.cc index ad0bd63..486716c 100644 --- a/chrome/browser/ui/panels/base_panel_browser_test.cc +++ b/chrome/browser/ui/panels/base_panel_browser_test.cc @@ -253,7 +253,7 @@ void BasePanelBrowserTest::WaitForPanelActiveState( void BasePanelBrowserTest::WaitForWindowSizeAvailable(Panel* panel) { scoped_ptr<NativePanelTesting> panel_testing( CreateNativePanelTesting(panel)); - ui_test_utils::WindowedNotificationObserver signal( + content::WindowedNotificationObserver signal( chrome::NOTIFICATION_PANEL_WINDOW_SIZE_KNOWN, content::Source<Panel>(panel)); if (panel_testing->IsWindowSizeKnown()) @@ -265,7 +265,7 @@ void BasePanelBrowserTest::WaitForWindowSizeAvailable(Panel* panel) { void BasePanelBrowserTest::WaitForBoundsAnimationFinished(Panel* panel) { scoped_ptr<NativePanelTesting> panel_testing( CreateNativePanelTesting(panel)); - ui_test_utils::WindowedNotificationObserver signal( + content::WindowedNotificationObserver signal( chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, content::Source<Panel>(panel)); if (!panel_testing->IsAnimatingBounds()) @@ -276,7 +276,7 @@ void BasePanelBrowserTest::WaitForBoundsAnimationFinished(Panel* panel) { void BasePanelBrowserTest::WaitForExpansionStateChanged( Panel* panel, Panel::ExpansionState expansion_state) { - ui_test_utils::WindowedNotificationObserver signal( + content::WindowedNotificationObserver signal( chrome::NOTIFICATION_PANEL_CHANGED_EXPANSION_STATE, content::Source<Panel>(panel)); if (panel->expansion_state() == expansion_state) @@ -297,7 +297,7 @@ Panel* BasePanelBrowserTest::CreatePanelWithParams( base::mac::ScopedNSAutoreleasePool autorelease_pool; #endif - ui_test_utils::WindowedNotificationObserver observer( + content::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, content::NotificationService::AllSources()); @@ -436,7 +436,7 @@ void BasePanelBrowserTest::CloseWindowAndWait(Panel* panel) { // message pump and wait for the notification. PanelManager* manager = PanelManager::GetInstance(); int panel_count = manager->num_panels(); - ui_test_utils::WindowedNotificationObserver signal( + content::WindowedNotificationObserver signal( chrome::NOTIFICATION_PANEL_CLOSED, content::Source<Panel>(panel)); panel->Close(); @@ -459,7 +459,7 @@ void BasePanelBrowserTest::CloseWindowAndWait(Panel* panel) { void BasePanelBrowserTest::MoveMouseAndWaitForExpansionStateChange( Panel* panel, const gfx::Point& position) { - ui_test_utils::WindowedNotificationObserver signal( + content::WindowedNotificationObserver signal( chrome::NOTIFICATION_PANEL_CHANGED_EXPANSION_STATE, content::Source<Panel>(panel)); MoveMouse(position); diff --git a/chrome/browser/ui/panels/docked_panel_browsertest.cc b/chrome/browser/ui/panels/docked_panel_browsertest.cc index c56e17d..f46c284 100644 --- a/chrome/browser/ui/panels/docked_panel_browsertest.cc +++ b/chrome/browser/ui/panels/docked_panel_browsertest.cc @@ -9,8 +9,8 @@ #include "chrome/browser/ui/panels/panel_manager.h" #include "chrome/browser/ui/panels/test_panel_mouse_watcher.h" #include "chrome/common/chrome_notification_types.h" -#include "chrome/test/base/ui_test_utils.h" #include "content/public/browser/notification_service.h" +#include "content/public/test/test_utils.h" // Refactor has only been done for Win and Mac panels so far. #if defined(OS_WIN) || defined(OS_MACOSX) @@ -183,7 +183,7 @@ IN_PROC_BROWSER_TEST_F(DockedPanelBrowserTest, MinimizeSqueezedActive) { EXPECT_EQ(width_of_panel3_squeezed, panel3->GetBounds().width()); // Minimize the active panel. It should become inactive and shrink in width. - ui_test_utils::WindowedNotificationObserver signal( + content::WindowedNotificationObserver signal( chrome::NOTIFICATION_PANEL_STRIP_UPDATED, content::NotificationService::AllSources()); panel7->Minimize(); diff --git a/chrome/browser/ui/panels/old_base_panel_browser_test.cc b/chrome/browser/ui/panels/old_base_panel_browser_test.cc index 938b130..ab0df4d 100644 --- a/chrome/browser/ui/panels/old_base_panel_browser_test.cc +++ b/chrome/browser/ui/panels/old_base_panel_browser_test.cc @@ -255,7 +255,7 @@ void OldBasePanelBrowserTest::WaitForPanelActiveState( void OldBasePanelBrowserTest::WaitForWindowSizeAvailable(Panel* panel) { scoped_ptr<NativePanelTesting> panel_testing( CreateNativePanelTesting(panel)); - ui_test_utils::WindowedNotificationObserver signal( + content::WindowedNotificationObserver signal( chrome::NOTIFICATION_PANEL_WINDOW_SIZE_KNOWN, content::Source<Panel>(panel)); if (panel_testing->IsWindowSizeKnown()) @@ -267,7 +267,7 @@ void OldBasePanelBrowserTest::WaitForWindowSizeAvailable(Panel* panel) { void OldBasePanelBrowserTest::WaitForBoundsAnimationFinished(Panel* panel) { scoped_ptr<NativePanelTesting> panel_testing( CreateNativePanelTesting(panel)); - ui_test_utils::WindowedNotificationObserver signal( + content::WindowedNotificationObserver signal( chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, content::Source<Panel>(panel)); if (!panel_testing->IsAnimatingBounds()) @@ -278,7 +278,7 @@ void OldBasePanelBrowserTest::WaitForBoundsAnimationFinished(Panel* panel) { void OldBasePanelBrowserTest::WaitForExpansionStateChanged( Panel* panel, Panel::ExpansionState expansion_state) { - ui_test_utils::WindowedNotificationObserver signal( + content::WindowedNotificationObserver signal( chrome::NOTIFICATION_PANEL_CHANGED_EXPANSION_STATE, content::Source<Panel>(panel)); if (panel->expansion_state() == expansion_state) @@ -306,7 +306,7 @@ Panel* OldBasePanelBrowserTest::CreatePanelWithParams( EXPECT_TRUE(panel_browser->is_type_panel()); if (!params.url.is_empty()) { - ui_test_utils::WindowedNotificationObserver observer( + content::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, content::NotificationService::AllSources()); chrome::AddSelectedTabWithURL(panel_browser, params.url, @@ -447,7 +447,7 @@ void OldBasePanelBrowserTest::CloseWindowAndWait(Panel* panel) { // message pump and wait for the notification. PanelManager* manager = PanelManager::GetInstance(); int panel_count = manager->num_panels(); - ui_test_utils::WindowedNotificationObserver signal( + content::WindowedNotificationObserver signal( chrome::NOTIFICATION_PANEL_CLOSED, content::Source<Panel>(panel)); panel->Close(); @@ -470,7 +470,7 @@ void OldBasePanelBrowserTest::CloseWindowAndWait(Panel* panel) { void OldBasePanelBrowserTest::MoveMouseAndWaitForExpansionStateChange( Panel* panel, const gfx::Point& position) { - ui_test_utils::WindowedNotificationObserver signal( + content::WindowedNotificationObserver signal( chrome::NOTIFICATION_PANEL_CHANGED_EXPANSION_STATE, content::Source<Panel>(panel)); MoveMouse(position); diff --git a/chrome/browser/ui/panels/old_docked_panel_browsertest.cc b/chrome/browser/ui/panels/old_docked_panel_browsertest.cc index d7bea4a..95af1d6 100644 --- a/chrome/browser/ui/panels/old_docked_panel_browsertest.cc +++ b/chrome/browser/ui/panels/old_docked_panel_browsertest.cc @@ -9,8 +9,8 @@ #include "chrome/browser/ui/panels/panel_manager.h" #include "chrome/browser/ui/panels/test_panel_mouse_watcher.h" #include "chrome/common/chrome_notification_types.h" -#include "chrome/test/base/ui_test_utils.h" #include "content/public/browser/notification_service.h" +#include "content/public/test/test_utils.h" class OldDockedPanelBrowserTest : public OldBasePanelBrowserTest { public: @@ -193,7 +193,7 @@ IN_PROC_BROWSER_TEST_F(OldDockedPanelBrowserTest, MAYBE_MinimizeSqueezedActive) EXPECT_EQ(width_of_panel3_squeezed, panel3->GetBounds().width()); // Minimize the active panel. It should become inactive and shrink in width. - ui_test_utils::WindowedNotificationObserver signal( + content::WindowedNotificationObserver signal( chrome::NOTIFICATION_PANEL_STRIP_UPDATED, content::NotificationService::AllSources()); panel7->Minimize(); diff --git a/chrome/browser/ui/panels/old_panel_browsertest.cc b/chrome/browser/ui/panels/old_panel_browsertest.cc index 79873ae..55b6259 100644 --- a/chrome/browser/ui/panels/old_panel_browsertest.cc +++ b/chrome/browser/ui/panels/old_panel_browsertest.cc @@ -367,7 +367,7 @@ IN_PROC_BROWSER_TEST_F(OldPanelBrowserTest, DISABLED_AutoResize) { // Expand the test page. gfx::Rect initial_bounds = panel->GetBounds(); - ui_test_utils::WindowedNotificationObserver enlarge( + content::WindowedNotificationObserver enlarge( chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, content::Source<Panel>(panel)); EXPECT_TRUE(ui_test_utils::ExecuteJavaScript( @@ -380,7 +380,7 @@ IN_PROC_BROWSER_TEST_F(OldPanelBrowserTest, DISABLED_AutoResize) { EXPECT_EQ(bounds_on_grow.height(), initial_bounds.height()); // Shrink the test page. - ui_test_utils::WindowedNotificationObserver shrink( + content::WindowedNotificationObserver shrink( chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, content::Source<Panel>(panel)); EXPECT_TRUE(ui_test_utils::ExecuteJavaScript( @@ -406,7 +406,7 @@ IN_PROC_BROWSER_TEST_F(OldPanelBrowserTest, DISABLED_AutoResize) { EXPECT_EQ(new_bounds.size(), panel->GetRestoredBounds().size()); // Turn back on auto-resize and verify that it works. - ui_test_utils::WindowedNotificationObserver auto_resize_enabled( + content::WindowedNotificationObserver auto_resize_enabled( chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, content::Source<Panel>(panel)); panel->SetAutoResizable(true); @@ -1260,7 +1260,7 @@ IN_PROC_BROWSER_TEST_F(OldPanelBrowserTest, Panel* panel2 = CreatePanelWithParams(params); // Close main tabbed window. - ui_test_utils::WindowedNotificationObserver signal( + content::WindowedNotificationObserver signal( chrome::NOTIFICATION_BROWSER_CLOSED, content::Source<Browser>(browser())); chrome::CloseWindow(browser()); @@ -1337,10 +1337,10 @@ IN_PROC_BROWSER_TEST_F(OldPanelBrowserTest, web_app::GenerateApplicationNameFromExtensionId(extension_other->id()); Panel* panel_other = CreatePanel(extension_app_name_other); - ui_test_utils::WindowedNotificationObserver signal( + content::WindowedNotificationObserver signal( chrome::NOTIFICATION_PANEL_CLOSED, content::Source<Panel>(panel)); - ui_test_utils::WindowedNotificationObserver signal1( + content::WindowedNotificationObserver signal1( chrome::NOTIFICATION_PANEL_CLOSED, content::Source<Panel>(panel1)); @@ -1400,7 +1400,7 @@ IN_PROC_BROWSER_TEST_F(OldPanelBrowserTest, OnBeforeUnloadOnClose) { // Close panel and respond to the onbeforeunload dialog with accept. This is // equivalent to clicking "Leave this page". - ui_test_utils::WindowedNotificationObserver signal( + content::WindowedNotificationObserver signal( chrome::NOTIFICATION_PANEL_CLOSED, content::Source<Panel>(panel)); panel->Close(); @@ -1453,7 +1453,7 @@ IN_PROC_BROWSER_TEST_F(OldPanelBrowserTest, TightAutosizeAroundSingleLine) { int initial_height = panel->GetBounds().height(); // Inject some HTML content into the panel. - ui_test_utils::WindowedNotificationObserver enlarge( + content::WindowedNotificationObserver enlarge( chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, content::Source<Panel>(panel)); EXPECT_TRUE(ui_test_utils::ExecuteJavaScript( diff --git a/chrome/browser/ui/panels/panel_browser_window_cocoa_unittest.mm b/chrome/browser/ui/panels/panel_browser_window_cocoa_unittest.mm index 651253e..2eaee38 100644 --- a/chrome/browser/ui/panels/panel_browser_window_cocoa_unittest.mm +++ b/chrome/browser/ui/panels/panel_browser_window_cocoa_unittest.mm @@ -25,15 +25,15 @@ #import "chrome/browser/ui/panels/panel_window_controller_cocoa.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_switches.h" -#include "chrome/test/base/ui_test_utils.h" +#include "content/public/test/test_utils.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest_mac.h" class PanelAnimatedBoundsObserver : - public ui_test_utils::WindowedNotificationObserver { + public content::WindowedNotificationObserver { public: PanelAnimatedBoundsObserver(Panel* panel) - : ui_test_utils::WindowedNotificationObserver( + : content::WindowedNotificationObserver( chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, content::Source<Panel>(panel)) { } virtual ~PanelAnimatedBoundsObserver() { } @@ -103,7 +103,7 @@ class PanelBrowserWindowCocoaTest : public CocoaProfileTest { // message pump and wait for the notification. PanelManager* manager = PanelManager::GetInstance(); int panel_count = manager->num_panels(); - ui_test_utils::WindowedNotificationObserver signal( + content::WindowedNotificationObserver signal( chrome::NOTIFICATION_PANEL_CLOSED, content::Source<Panel>(panel)); panel->Close(); @@ -300,7 +300,7 @@ TEST_F(PanelBrowserWindowCocoaTest, TitlebarViewClose) { PanelManager* manager = PanelManager::GetInstance(); EXPECT_EQ(1, manager->num_panels()); // Simulate clicking Close Button and wait until the Panel closes. - ui_test_utils::WindowedNotificationObserver signal( + content::WindowedNotificationObserver signal( chrome::NOTIFICATION_PANEL_CLOSED, content::Source<Panel>(panel)); [titlebar simulateCloseButtonClick]; diff --git a/chrome/browser/ui/panels/panel_browsertest.cc b/chrome/browser/ui/panels/panel_browsertest.cc index f110c49..9c4677c 100644 --- a/chrome/browser/ui/panels/panel_browsertest.cc +++ b/chrome/browser/ui/panels/panel_browsertest.cc @@ -374,7 +374,7 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest, AutoResize) { // Expand the test page. The resize will update the docked panel strip. gfx::Rect initial_bounds = panel->GetBounds(); - ui_test_utils::WindowedNotificationObserver enlarge( + content::WindowedNotificationObserver enlarge( chrome::NOTIFICATION_PANEL_STRIP_UPDATED, content::NotificationService::AllSources()); EXPECT_TRUE(ui_test_utils::ExecuteJavaScript( @@ -387,7 +387,7 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest, AutoResize) { EXPECT_EQ(bounds_on_grow.height(), initial_bounds.height()); // Shrink the test page. The resize will update the docked panel strip. - ui_test_utils::WindowedNotificationObserver shrink( + content::WindowedNotificationObserver shrink( chrome::NOTIFICATION_PANEL_STRIP_UPDATED, content::NotificationService::AllSources()); EXPECT_TRUE(ui_test_utils::ExecuteJavaScript( @@ -413,7 +413,7 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest, AutoResize) { EXPECT_EQ(new_bounds.size(), panel->GetRestoredBounds().size()); // Turn back on auto-resize and verify that panel auto resizes. - ui_test_utils::WindowedNotificationObserver auto_resize_enabled( + content::WindowedNotificationObserver auto_resize_enabled( chrome::NOTIFICATION_PANEL_STRIP_UPDATED, content::NotificationService::AllSources()); panel->SetAutoResizable(true); @@ -1338,7 +1338,7 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest, Panel* panel2 = CreatePanelWithParams(params); // Close main tabbed window. - ui_test_utils::WindowedNotificationObserver signal( + content::WindowedNotificationObserver signal( chrome::NOTIFICATION_BROWSER_CLOSED, content::Source<Browser>(browser())); chrome::CloseWindow(browser()); @@ -1408,10 +1408,10 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest, web_app::GenerateApplicationNameFromExtensionId(extension_other->id()); Panel* panel_other = CreatePanel(extension_app_name_other); - ui_test_utils::WindowedNotificationObserver signal( + content::WindowedNotificationObserver signal( chrome::NOTIFICATION_PANEL_CLOSED, content::Source<Panel>(panel)); - ui_test_utils::WindowedNotificationObserver signal1( + content::WindowedNotificationObserver signal1( chrome::NOTIFICATION_PANEL_CLOSED, content::Source<Panel>(panel1)); @@ -1497,7 +1497,7 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest, int initial_height = panel->GetBounds().height(); // Inject some HTML content into the panel. - ui_test_utils::WindowedNotificationObserver enlarge( + content::WindowedNotificationObserver enlarge( chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, content::Source<Panel>(panel)); EXPECT_TRUE(ui_test_utils::ExecuteJavaScript( diff --git a/chrome/browser/ui/panels/panel_cocoa_unittest.mm b/chrome/browser/ui/panels/panel_cocoa_unittest.mm index d2f262e..89b4f5f 100644 --- a/chrome/browser/ui/panels/panel_cocoa_unittest.mm +++ b/chrome/browser/ui/panels/panel_cocoa_unittest.mm @@ -21,15 +21,15 @@ #import "chrome/browser/ui/panels/panel_window_controller_cocoa.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_switches.h" -#include "chrome/test/base/ui_test_utils.h" +#include "content/public/test/test_utils.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest_mac.h" class PanelAnimatedBoundsObserver : - public ui_test_utils::WindowedNotificationObserver { + public content::WindowedNotificationObserver { public: PanelAnimatedBoundsObserver(Panel* panel) - : ui_test_utils::WindowedNotificationObserver( + : content::WindowedNotificationObserver( chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, content::Source<Panel>(panel)) { } virtual ~PanelAnimatedBoundsObserver() { } @@ -94,7 +94,7 @@ class PanelCocoaTest : public CocoaProfileTest { // message pump and wait for the notification. PanelManager* manager = PanelManager::GetInstance(); int panel_count = manager->num_panels(); - ui_test_utils::WindowedNotificationObserver signal( + content::WindowedNotificationObserver signal( chrome::NOTIFICATION_PANEL_CLOSED, content::Source<Panel>(panel)); panel->Close(); @@ -283,7 +283,7 @@ TEST_F(PanelCocoaTest, TitlebarViewClose) { PanelManager* manager = PanelManager::GetInstance(); EXPECT_EQ(1, manager->num_panels()); // Simulate clicking Close Button and wait until the Panel closes. - ui_test_utils::WindowedNotificationObserver signal( + content::WindowedNotificationObserver signal( chrome::NOTIFICATION_PANEL_CLOSED, content::Source<Panel>(panel)); [titlebar simulateCloseButtonClick]; diff --git a/chrome/browser/ui/panels/test_panel_active_state_observer.cc b/chrome/browser/ui/panels/test_panel_active_state_observer.cc index 3e53995..b96e547 100644 --- a/chrome/browser/ui/panels/test_panel_active_state_observer.cc +++ b/chrome/browser/ui/panels/test_panel_active_state_observer.cc @@ -6,6 +6,9 @@ #include "chrome/browser/ui/panels/panel.h" #include "chrome/common/chrome_notification_types.h" +#include "content/public/browser/notification_source.h" +#include "content/public/test/test_utils.h" +#include "testing/gtest/include/gtest/gtest.h" PanelActiveStateObserver::PanelActiveStateObserver( Panel* panel, @@ -25,7 +28,7 @@ void PanelActiveStateObserver::Wait() { return; running_ = true; - message_loop_runner_ = new ui_test_utils::MessageLoopRunner; + message_loop_runner_ = new content::MessageLoopRunner; message_loop_runner_->Run(); EXPECT_TRUE(seen_); } diff --git a/chrome/browser/ui/panels/test_panel_active_state_observer.h b/chrome/browser/ui/panels/test_panel_active_state_observer.h index b1e8744..066d87f 100644 --- a/chrome/browser/ui/panels/test_panel_active_state_observer.h +++ b/chrome/browser/ui/panels/test_panel_active_state_observer.h @@ -5,10 +5,16 @@ #ifndef CHROME_BROWSER_UI_PANELS_TEST_PANEL_ACTIVE_STATE_OBSERVER_H_ #define CHROME_BROWSER_UI_PANELS_TEST_PANEL_ACTIVE_STATE_OBSERVER_H_ -#include "chrome/test/base/ui_test_utils.h" +#include "base/memory/ref_counted.h" +#include "content/public/browser/notification_observer.h" +#include "content/public/browser/notification_registrar.h" class Panel; +namespace content { +class MessageLoopRunner; +} + // Custom notification observer for waiting on panel active state. // Modeled after ui_test_utils notification observers. class PanelActiveStateObserver : public content::NotificationObserver { @@ -34,7 +40,7 @@ class PanelActiveStateObserver : public content::NotificationObserver { bool seen_; // true after transition to expected state has been seen bool running_; // indicates whether message loop is running content::NotificationRegistrar registrar_; - scoped_refptr<ui_test_utils::MessageLoopRunner> message_loop_runner_; + scoped_refptr<content::MessageLoopRunner> message_loop_runner_; DISALLOW_COPY_AND_ASSIGN(PanelActiveStateObserver); }; |