| Index: ash/common/system/tray/tray_details_view_unittest.cc
|
| diff --git a/ash/common/system/tray/tray_details_view_unittest.cc b/ash/common/system/tray/tray_details_view_unittest.cc
|
| index a3eceb2e548a795da13b38f0953d30786a3baae9..a62f8b64dab09e3e05c643d89959dbc8b2695ad6 100644
|
| --- a/ash/common/system/tray/tray_details_view_unittest.cc
|
| +++ b/ash/common/system/tray/tray_details_view_unittest.cc
|
| @@ -5,7 +5,6 @@
|
| #include "ash/common/system/tray/tray_details_view.h"
|
|
|
| #include "ash/common/ash_view_ids.h"
|
| -#include "ash/common/material_design/material_design_controller.h"
|
| #include "ash/common/system/tray/hover_highlight_view.h"
|
| #include "ash/common/system/tray/special_popup_row.h"
|
| #include "ash/common/system/tray/system_tray.h"
|
| @@ -46,22 +45,6 @@ class TestDetailsView : public TrayDetailsView {
|
|
|
| void FocusTitleRow() { title_row()->content()->RequestFocus(); }
|
|
|
| - // TrayDetailsView:
|
| - void CreateExtraTitleRowButtons() override {
|
| - // TODO(tdanderson): Add test coverage for material design buttons in the
|
| - // title row once they are implemented.
|
| - if (MaterialDesignController::IsSystemTrayMenuMaterial())
|
| - return;
|
| -
|
| - tray_popup_header_button_ =
|
| - new TrayPopupHeaderButton(this, IDR_AURA_UBER_TRAY_BLUETOOTH_ENABLED,
|
| - IDR_AURA_UBER_TRAY_BLUETOOTH_DISABLED,
|
| - IDR_AURA_UBER_TRAY_BLUETOOTH_ENABLED_HOVER,
|
| - IDR_AURA_UBER_TRAY_BLUETOOTH_DISABLED_HOVER,
|
| - IDS_ASH_STATUS_TRAY_BLUETOOTH);
|
| - title_row()->AddViewToRowNonMd(tray_popup_header_button_, true);
|
| - }
|
| -
|
| void CreateScrollerViews() { CreateScrollableList(); }
|
|
|
| private:
|
| @@ -184,10 +167,7 @@ TEST_F(TrayDetailsViewTest, TransitionToDefaultViewTest) {
|
| // Transition back to default view, the default view of item 2 should have
|
| // focus.
|
| tray->GetSystemBubble()->bubble_view()->set_can_activate(true);
|
| - if (MaterialDesignController::IsSystemTrayMenuMaterial())
|
| - FocusBackButton(test_item_2->detailed_view());
|
| - else
|
| - test_item_2->detailed_view()->FocusTitleRow();
|
| + FocusBackButton(test_item_2->detailed_view());
|
| TransitionFromDetailedToDefaultView(test_item_2->detailed_view());
|
| RunAllPendingInMessageLoop();
|
|
|
| @@ -211,111 +191,6 @@ TEST_F(TrayDetailsViewTest, TransitionToDefaultViewTest) {
|
| EXPECT_FALSE(test_item_2->default_view()->HasFocus());
|
| }
|
|
|
| -// Tests that HoverHighlightView enters hover state in response to touch.
|
| -TEST_F(TrayDetailsViewTest, HoverHighlightViewTouchFeedback) {
|
| - // Material design detailed views will not use the visual feedback from
|
| - // HoverHighlightView.
|
| - if (MaterialDesignController::IsSystemTrayMenuMaterial())
|
| - return;
|
| -
|
| - HoverHighlightView* view = CreateAndShowHoverHighlightView();
|
| - EXPECT_FALSE(view->hover());
|
| -
|
| - ui::test::EventGenerator& generator = GetEventGenerator();
|
| - generator.set_current_location(view->GetBoundsInScreen().CenterPoint());
|
| - generator.PressTouch();
|
| - EXPECT_TRUE(view->hover());
|
| -
|
| - generator.ReleaseTouch();
|
| -}
|
| -
|
| -// Tests that touch events leaving HoverHighlightView cancel the hover state.
|
| -TEST_F(TrayDetailsViewTest, HoverHighlightViewTouchFeedbackCancellation) {
|
| - // Material design detailed views will not use the visual feedback from
|
| - // HoverHighlightView.
|
| - if (MaterialDesignController::IsSystemTrayMenuMaterial())
|
| - return;
|
| -
|
| - HoverHighlightView* view = CreateAndShowHoverHighlightView();
|
| - EXPECT_FALSE(view->hover());
|
| -
|
| - gfx::Rect view_bounds = view->GetBoundsInScreen();
|
| - ui::test::EventGenerator& generator = GetEventGenerator();
|
| - generator.set_current_location(view_bounds.CenterPoint());
|
| - generator.PressTouch();
|
| - EXPECT_TRUE(view->hover());
|
| -
|
| - gfx::Point move_point(view_bounds.x(), view_bounds.CenterPoint().y());
|
| - generator.MoveTouch(move_point);
|
| - EXPECT_FALSE(view->hover());
|
| -
|
| - generator.set_current_location(move_point);
|
| - generator.ReleaseTouch();
|
| - EXPECT_FALSE(view->hover());
|
| -}
|
| -
|
| -// Tests that TrayPopupHeaderButton renders a background in response to touch.
|
| -TEST_F(TrayDetailsViewTest, TrayPopupHeaderButtonTouchFeedback) {
|
| - // Material design detailed views will not use TrayPopupHeaderButton.
|
| - if (MaterialDesignController::IsSystemTrayMenuMaterial())
|
| - return;
|
| -
|
| - TrayPopupHeaderButton* button = CreateAndShowTrayPopupHeaderButton();
|
| - EXPECT_FALSE(button->background());
|
| -
|
| - ui::test::EventGenerator& generator = GetEventGenerator();
|
| - generator.set_current_location(button->GetBoundsInScreen().CenterPoint());
|
| - generator.PressTouch();
|
| - EXPECT_TRUE(button->background());
|
| -
|
| - generator.ReleaseTouch();
|
| - EXPECT_FALSE(button->background());
|
| -}
|
| -
|
| -// Tests that touch events leaving TrayPopupHeaderButton cancel the touch
|
| -// feedback background.
|
| -TEST_F(TrayDetailsViewTest, TrayPopupHeaderButtonTouchFeedbackCancellation) {
|
| - // Material design detailed views will not use TrayPopupHeaderButton.
|
| - if (MaterialDesignController::IsSystemTrayMenuMaterial())
|
| - return;
|
| -
|
| - TrayPopupHeaderButton* button = CreateAndShowTrayPopupHeaderButton();
|
| - EXPECT_FALSE(button->background());
|
| -
|
| - gfx::Rect view_bounds = button->GetBoundsInScreen();
|
| - ui::test::EventGenerator& generator = GetEventGenerator();
|
| - generator.set_current_location(view_bounds.CenterPoint());
|
| - generator.PressTouch();
|
| - EXPECT_TRUE(button->background());
|
| -
|
| - gfx::Point move_point(view_bounds.x(), view_bounds.CenterPoint().y());
|
| - generator.MoveTouch(move_point);
|
| - EXPECT_FALSE(button->background());
|
| -
|
| - generator.set_current_location(move_point);
|
| - generator.ReleaseTouch();
|
| - EXPECT_FALSE(button->background());
|
| -}
|
| -
|
| -// Tests that a mouse entering TrayPopupHeaderButton renders a background as
|
| -// visual feedback.
|
| -TEST_F(TrayDetailsViewTest, TrayPopupHeaderButtonMouseHoverFeedback) {
|
| - // Material design detailed views will not use TrayPopupHeaderButton.
|
| - if (MaterialDesignController::IsSystemTrayMenuMaterial())
|
| - return;
|
| -
|
| - TrayPopupHeaderButton* button = CreateAndShowTrayPopupHeaderButton();
|
| - EXPECT_FALSE(button->background());
|
| -
|
| - ui::test::EventGenerator& generator = GetEventGenerator();
|
| - gfx::Rect bounds = button->GetBoundsInScreen();
|
| - gfx::Point initial_point(bounds.x() - 1, bounds.y());
|
| - generator.set_current_location(initial_point);
|
| - generator.MoveMouseBy(1, 0);
|
| - RunAllPendingInMessageLoop();
|
| - EXPECT_TRUE(button->background());
|
| -}
|
| -
|
| TEST_F(TrayDetailsViewTest, ScrollContentsTest) {
|
| SystemTray* tray = GetPrimarySystemTray();
|
| TestItem* test_item = new TestItem;
|
|
|