Commit 20e23d07 authored by pkotwicz@chromium.org's avatar pkotwicz@chromium.org

Reenable most panel interactive_ui_tests on Linux

BUG=382301
TEST=Panel interactive_ui_tests pass

Review URL: https://codereview.chromium.org/368163004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283752 0039d316-1c4b-4281-b951-d872f2087c98
parent c76b3f9b
...@@ -41,10 +41,12 @@ IN_PROC_BROWSER_TEST_F(DetachedPanelBrowserTest, CheckDetachedPanelProperties) { ...@@ -41,10 +41,12 @@ IN_PROC_BROWSER_TEST_F(DetachedPanelBrowserTest, CheckDetachedPanelProperties) {
EXPECT_TRUE(panel_testing->IsButtonVisible(panel::CLOSE_BUTTON)); EXPECT_TRUE(panel_testing->IsButtonVisible(panel::CLOSE_BUTTON));
// The minimize button will not be shown on some Linux desktop environment // The minimize button will not be shown on some Linux desktop environment
// that does not support system minimize. // that does not support system minimize.
if (PanelManager::CanUseSystemMinimize()) if (PanelManager::CanUseSystemMinimize() &&
PanelManager::IsPanelStackingEnabled()) {
EXPECT_TRUE(panel_testing->IsButtonVisible(panel::MINIMIZE_BUTTON)); EXPECT_TRUE(panel_testing->IsButtonVisible(panel::MINIMIZE_BUTTON));
else } else {
EXPECT_FALSE(panel_testing->IsButtonVisible(panel::MINIMIZE_BUTTON)); EXPECT_FALSE(panel_testing->IsButtonVisible(panel::MINIMIZE_BUTTON));
}
EXPECT_FALSE(panel_testing->IsButtonVisible(panel::RESTORE_BUTTON)); EXPECT_FALSE(panel_testing->IsButtonVisible(panel::RESTORE_BUTTON));
EXPECT_EQ(panel::RESIZABLE_ALL, panel->CanResizeByMouse()); EXPECT_EQ(panel::RESIZABLE_ALL, panel->CanResizeByMouse());
......
...@@ -521,11 +521,8 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest, AnimateBounds) { ...@@ -521,11 +521,8 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest, AnimateBounds) {
// Set bounds with animation. // Set bounds with animation.
gfx::Rect bounds = gfx::Rect(10, 20, 150, 160); gfx::Rect bounds = gfx::Rect(10, 20, 150, 160);
panel->SetPanelBounds(bounds); panel->SetPanelBounds(bounds);
// There is no animation on Linux, by design.
#if !defined(OS_LINUX)
EXPECT_TRUE(panel_testing->IsAnimatingBounds()); EXPECT_TRUE(panel_testing->IsAnimatingBounds());
WaitForBoundsAnimationFinished(panel); WaitForBoundsAnimationFinished(panel);
#endif
EXPECT_FALSE(panel_testing->IsAnimatingBounds()); EXPECT_FALSE(panel_testing->IsAnimatingBounds());
EXPECT_EQ(bounds, panel->GetBounds()); EXPECT_EQ(bounds, panel->GetBounds());
...@@ -1727,14 +1724,8 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest, ...@@ -1727,14 +1724,8 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest,
EXPECT_TRUE(panel_testing->IsWindowVisible()); EXPECT_TRUE(panel_testing->IsWindowVisible());
// Panel should become hidden when entering full-screen mode. // Panel should become hidden when entering full-screen mode.
// Note that this is not needed on Linux because the full-screen window will
// be always placed above any other windows.
mock_display_settings_provider()->EnableFullScreenMode(true); mock_display_settings_provider()->EnableFullScreenMode(true);
#if defined(OS_LINUX)
EXPECT_TRUE(panel_testing->IsWindowVisible());
#else
EXPECT_FALSE(panel_testing->IsWindowVisible()); EXPECT_FALSE(panel_testing->IsWindowVisible());
#endif
// Panel should become visible when leaving full-screen mode. // Panel should become visible when leaving full-screen mode.
mock_display_settings_provider()->EnableFullScreenMode(false); mock_display_settings_provider()->EnableFullScreenMode(false);
......
...@@ -98,9 +98,10 @@ const std::map<ui::Accelerator, int>& GetAcceleratorTable() { ...@@ -98,9 +98,10 @@ const std::map<ui::Accelerator, int>& GetAcceleratorTable() {
} }
// NativePanelTesting implementation. // NativePanelTesting implementation.
class NativePanelTestingWin : public NativePanelTesting { class NativePanelTestingViews : public NativePanelTesting {
public: public:
explicit NativePanelTestingWin(PanelView* panel_view); explicit NativePanelTestingViews(PanelView* panel_view);
virtual ~NativePanelTestingViews();
private: private:
virtual void PressLeftMouseButtonTitlebar( virtual void PressLeftMouseButtonTitlebar(
...@@ -125,45 +126,48 @@ class NativePanelTestingWin : public NativePanelTesting { ...@@ -125,45 +126,48 @@ class NativePanelTestingWin : public NativePanelTesting {
PanelView* panel_view_; PanelView* panel_view_;
}; };
NativePanelTestingWin::NativePanelTestingWin(PanelView* panel_view) NativePanelTestingViews::NativePanelTestingViews(PanelView* panel_view)
: panel_view_(panel_view) { : panel_view_(panel_view) {
} }
void NativePanelTestingWin::PressLeftMouseButtonTitlebar( NativePanelTestingViews::~NativePanelTestingViews() {
}
void NativePanelTestingViews::PressLeftMouseButtonTitlebar(
const gfx::Point& mouse_location, panel::ClickModifier modifier) { const gfx::Point& mouse_location, panel::ClickModifier modifier) {
panel_view_->OnTitlebarMousePressed(mouse_location); panel_view_->OnTitlebarMousePressed(mouse_location);
} }
void NativePanelTestingWin::ReleaseMouseButtonTitlebar( void NativePanelTestingViews::ReleaseMouseButtonTitlebar(
panel::ClickModifier modifier) { panel::ClickModifier modifier) {
panel_view_->OnTitlebarMouseReleased(modifier); panel_view_->OnTitlebarMouseReleased(modifier);
} }
void NativePanelTestingWin::DragTitlebar(const gfx::Point& mouse_location) { void NativePanelTestingViews::DragTitlebar(const gfx::Point& mouse_location) {
panel_view_->OnTitlebarMouseDragged(mouse_location); panel_view_->OnTitlebarMouseDragged(mouse_location);
} }
void NativePanelTestingWin::CancelDragTitlebar() { void NativePanelTestingViews::CancelDragTitlebar() {
panel_view_->OnTitlebarMouseCaptureLost(); panel_view_->OnTitlebarMouseCaptureLost();
} }
void NativePanelTestingWin::FinishDragTitlebar() { void NativePanelTestingViews::FinishDragTitlebar() {
panel_view_->OnTitlebarMouseReleased(panel::NO_MODIFIER); panel_view_->OnTitlebarMouseReleased(panel::NO_MODIFIER);
} }
bool NativePanelTestingWin::VerifyDrawingAttention() const { bool NativePanelTestingViews::VerifyDrawingAttention() const {
base::MessageLoop::current()->RunUntilIdle(); base::MessageLoop::current()->RunUntilIdle();
return panel_view_->GetFrameView()->GetPaintState() == return panel_view_->GetFrameView()->GetPaintState() ==
PanelFrameView::PAINT_FOR_ATTENTION; PanelFrameView::PAINT_FOR_ATTENTION;
} }
bool NativePanelTestingWin::VerifyActiveState(bool is_active) { bool NativePanelTestingViews::VerifyActiveState(bool is_active) {
return panel_view_->GetFrameView()->GetPaintState() == return panel_view_->GetFrameView()->GetPaintState() ==
(is_active ? PanelFrameView::PAINT_AS_ACTIVE (is_active ? PanelFrameView::PAINT_AS_ACTIVE
: PanelFrameView::PAINT_AS_INACTIVE); : PanelFrameView::PAINT_AS_INACTIVE);
} }
bool NativePanelTestingWin::VerifyAppIcon() const { bool NativePanelTestingViews::VerifyAppIcon() const {
#if defined(OS_WIN) #if defined(OS_WIN)
// We only care about Windows 7 and later. // We only care about Windows 7 and later.
if (base::win::GetVersion() < base::win::VERSION_WIN7) if (base::win::GetVersion() < base::win::VERSION_WIN7)
...@@ -183,7 +187,7 @@ bool NativePanelTestingWin::VerifyAppIcon() const { ...@@ -183,7 +187,7 @@ bool NativePanelTestingWin::VerifyAppIcon() const {
#endif #endif
} }
bool NativePanelTestingWin::VerifySystemMinimizeState() const { bool NativePanelTestingViews::VerifySystemMinimizeState() const {
#if defined(OS_WIN) #if defined(OS_WIN)
HWND native_window = views::HWNDForWidget(panel_view_->window()); HWND native_window = views::HWNDForWidget(panel_view_->window());
WINDOWPLACEMENT placement; WINDOWPLACEMENT placement;
...@@ -207,24 +211,19 @@ bool NativePanelTestingWin::VerifySystemMinimizeState() const { ...@@ -207,24 +211,19 @@ bool NativePanelTestingWin::VerifySystemMinimizeState() const {
#endif #endif
} }
bool NativePanelTestingWin::IsWindowVisible() const { bool NativePanelTestingViews::IsWindowVisible() const {
#if defined(OS_WIN) return panel_view_->window()->IsVisible();
HWND native_window = views::HWNDForWidget(panel_view_->window());
return ::IsWindowVisible(native_window) == TRUE;
#else
return panel_view_->visible();
#endif
} }
bool NativePanelTestingWin::IsWindowSizeKnown() const { bool NativePanelTestingViews::IsWindowSizeKnown() const {
return true; return true;
} }
bool NativePanelTestingWin::IsAnimatingBounds() const { bool NativePanelTestingViews::IsAnimatingBounds() const {
return panel_view_->IsAnimatingBounds(); return panel_view_->IsAnimatingBounds();
} }
bool NativePanelTestingWin::IsButtonVisible( bool NativePanelTestingViews::IsButtonVisible(
panel::TitlebarButtonType button_type) const { panel::TitlebarButtonType button_type) const {
PanelFrameView* frame_view = panel_view_->GetFrameView(); PanelFrameView* frame_view = panel_view_->GetFrameView();
...@@ -241,11 +240,11 @@ bool NativePanelTestingWin::IsButtonVisible( ...@@ -241,11 +240,11 @@ bool NativePanelTestingWin::IsButtonVisible(
return false; return false;
} }
panel::CornerStyle NativePanelTestingWin::GetWindowCornerStyle() const { panel::CornerStyle NativePanelTestingViews::GetWindowCornerStyle() const {
return panel_view_->GetFrameView()->corner_style(); return panel_view_->GetFrameView()->corner_style();
} }
bool NativePanelTestingWin::EnsureApplicationRunOnForeground() { bool NativePanelTestingViews::EnsureApplicationRunOnForeground() {
// Not needed on views. // Not needed on views.
return true; return true;
} }
...@@ -753,7 +752,7 @@ void PanelView::DetachWebContents(content::WebContents* contents) { ...@@ -753,7 +752,7 @@ void PanelView::DetachWebContents(content::WebContents* contents) {
} }
NativePanelTesting* PanelView::CreateNativePanelTesting() { NativePanelTesting* PanelView::CreateNativePanelTesting() {
return new NativePanelTestingWin(this); return new NativePanelTestingViews(this);
} }
void PanelView::OnDisplayChanged() { void PanelView::OnDisplayChanged() {
...@@ -992,7 +991,6 @@ void PanelView::OnWidgetActivationChanged(views::Widget* widget, bool active) { ...@@ -992,7 +991,6 @@ void PanelView::OnWidgetActivationChanged(views::Widget* widget, bool active) {
views::HWNDForWidget(widget) == ::GetForegroundWindow(); views::HWNDForWidget(widget) == ::GetForegroundWindow();
} }
#else #else
NOTIMPLEMENTED();
bool focused = active; bool focused = active;
#endif #endif
......
...@@ -135,6 +135,9 @@ IN_PROC_BROWSER_TEST_F(PanelViewTest, PanelLayout) { ...@@ -135,6 +135,9 @@ IN_PROC_BROWSER_TEST_F(PanelViewTest, PanelLayout) {
EXPECT_LT(minimize_button->x() + minimize_button->width(), close_button->x()); EXPECT_LT(minimize_button->x() + minimize_button->width(), close_button->x());
} }
// TODO(pkotwicz): Enable on Linux crbug.com/382301
#if !defined(OS_LINUX)
IN_PROC_BROWSER_TEST_F(PanelViewTest, CheckTitleOnlyHeight) { IN_PROC_BROWSER_TEST_F(PanelViewTest, CheckTitleOnlyHeight) {
gfx::Rect bounds(0, 0, 200, 50); gfx::Rect bounds(0, 0, 200, 50);
Panel* panel = CreatePanelWithBounds("PanelTest", bounds); Panel* panel = CreatePanelWithBounds("PanelTest", bounds);
...@@ -160,3 +163,4 @@ IN_PROC_BROWSER_TEST_F(PanelViewTest, CheckMinimizedHeight) { ...@@ -160,3 +163,4 @@ IN_PROC_BROWSER_TEST_F(PanelViewTest, CheckMinimizedHeight) {
panel->Close(); panel->Close();
} }
#endif
...@@ -181,15 +181,8 @@ ...@@ -181,15 +181,8 @@
# when run under openbox. # when run under openbox.
# #
# Merge this back into the next block post switch to linux_aura. # Merge this back into the next block post switch to linux_aura.
'browser/ui/panels/base_panel_browser_test.cc',
'browser/ui/panels/base_panel_browser_test.h',
'browser/ui/panels/detached_panel_browsertest.cc',
'browser/ui/panels/docked_panel_browsertest.cc',
'browser/ui/panels/panel_browsertest.cc',
'browser/ui/panels/panel_drag_browsertest.cc', 'browser/ui/panels/panel_drag_browsertest.cc',
'browser/ui/panels/panel_resize_browsertest.cc',
'browser/ui/panels/stacked_panel_browsertest.cc', 'browser/ui/panels/stacked_panel_browsertest.cc',
'browser/ui/views/panels/panel_view_browsertest.cc',
], ],
}], }],
['OS=="linux" and use_aura==1 and chromeos==0', { ['OS=="linux" and use_aura==1 and chromeos==0', {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment