Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(738)

Unified Diff: ash/shelf/shelf_tooltip_manager_unittest.cc

Issue 2070143003: Add MD ink drop ripple to app list button (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@b612539_shelf_button_ripple
Patch Set: Rebased Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shelf/shelf_button.cc ('k') | ash/shelf/shelf_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_tooltip_manager_unittest.cc
diff --git a/ash/shelf/shelf_tooltip_manager_unittest.cc b/ash/shelf/shelf_tooltip_manager_unittest.cc
index 1f708832fbd8dd2d979592ef02810867170cfb9f..b03eb96c054924b48f638c192559c54adc0e551f 100644
--- a/ash/shelf/shelf_tooltip_manager_unittest.cc
+++ b/ash/shelf/shelf_tooltip_manager_unittest.cc
@@ -6,6 +6,7 @@
#include "ash/common/shelf/shelf_item_delegate_manager.h"
#include "ash/common/shelf/shelf_model.h"
+#include "ash/shelf/app_list_button.h"
#include "ash/shelf/shelf_layout_manager.h"
#include "ash/shelf/shelf_view.h"
#include "ash/shelf/shelf_widget.h"
@@ -49,14 +50,14 @@ class ShelfTooltipManagerTest : public AshTestBase {
};
TEST_F(ShelfTooltipManagerTest, ShowTooltip) {
- tooltip_manager_->ShowTooltip(shelf_->GetAppListButtonView());
+ tooltip_manager_->ShowTooltip(shelf_->GetAppListButton());
EXPECT_TRUE(tooltip_manager_->IsVisible());
EXPECT_FALSE(IsTimerRunning());
}
TEST_F(ShelfTooltipManagerTest, ShowTooltipWithDelay) {
// ShowTooltipWithDelay should start the timer instead of showing immediately.
- tooltip_manager_->ShowTooltipWithDelay(shelf_->GetAppListButtonView());
+ tooltip_manager_->ShowTooltipWithDelay(shelf_->GetAppListButton());
EXPECT_FALSE(tooltip_manager_->IsVisible());
EXPECT_TRUE(IsTimerRunning());
RunAllPendingInMessageLoop();
@@ -103,7 +104,7 @@ TEST_F(ShelfTooltipManagerTest, DoNotShowForInvalidView) {
}
TEST_F(ShelfTooltipManagerTest, HideWhenShelfIsHidden) {
- tooltip_manager_->ShowTooltip(shelf_->GetAppListButtonView());
+ tooltip_manager_->ShowTooltip(shelf_->GetAppListButton());
ASSERT_TRUE(tooltip_manager_->IsVisible());
// Create a full-screen window to hide the shelf.
@@ -120,11 +121,11 @@ TEST_F(ShelfTooltipManagerTest, HideWhenShelfIsHidden) {
EXPECT_FALSE(tooltip_manager_->IsVisible());
// Do not show the view if the shelf is hidden.
- tooltip_manager_->ShowTooltip(shelf_->GetAppListButtonView());
+ tooltip_manager_->ShowTooltip(shelf_->GetAppListButton());
EXPECT_FALSE(tooltip_manager_->IsVisible());
// ShowTooltipWithDelay doesn't even start the timer for the hidden shelf.
- tooltip_manager_->ShowTooltipWithDelay(shelf_->GetAppListButtonView());
+ tooltip_manager_->ShowTooltipWithDelay(shelf_->GetAppListButton());
EXPECT_FALSE(IsTimerRunning());
}
@@ -137,7 +138,7 @@ TEST_F(ShelfTooltipManagerTest, HideWhenShelfIsAutoHide) {
dummy->Init(params);
dummy->Show();
- tooltip_manager_->ShowTooltip(shelf_->GetAppListButtonView());
+ tooltip_manager_->ShowTooltip(shelf_->GetAppListButton());
ASSERT_TRUE(tooltip_manager_->IsVisible());
shelf_->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
@@ -150,11 +151,11 @@ TEST_F(ShelfTooltipManagerTest, HideWhenShelfIsAutoHide) {
EXPECT_FALSE(tooltip_manager_->IsVisible());
// Do not show the view if the shelf is hidden.
- tooltip_manager_->ShowTooltip(shelf_->GetAppListButtonView());
+ tooltip_manager_->ShowTooltip(shelf_->GetAppListButton());
EXPECT_FALSE(tooltip_manager_->IsVisible());
// ShowTooltipWithDelay doesn't even run the timer for the hidden shelf.
- tooltip_manager_->ShowTooltipWithDelay(shelf_->GetAppListButtonView());
+ tooltip_manager_->ShowTooltipWithDelay(shelf_->GetAppListButton());
EXPECT_FALSE(IsTimerRunning());
}
@@ -163,28 +164,28 @@ TEST_F(ShelfTooltipManagerTest, HideForEvents) {
gfx::Rect shelf_bounds = shelf_->shelf_widget()->GetNativeWindow()->bounds();
// Should hide if the mouse exits the shelf area.
- tooltip_manager_->ShowTooltip(shelf_->GetAppListButtonView());
+ tooltip_manager_->ShowTooltip(shelf_->GetAppListButton());
ASSERT_TRUE(tooltip_manager_->IsVisible());
generator.MoveMouseTo(shelf_bounds.CenterPoint());
generator.SendMouseExit();
EXPECT_FALSE(tooltip_manager_->IsVisible());
// Should hide if the mouse is pressed in the shelf area.
- tooltip_manager_->ShowTooltip(shelf_->GetAppListButtonView());
+ tooltip_manager_->ShowTooltip(shelf_->GetAppListButton());
ASSERT_TRUE(tooltip_manager_->IsVisible());
generator.MoveMouseTo(shelf_bounds.CenterPoint());
generator.PressLeftButton();
EXPECT_FALSE(tooltip_manager_->IsVisible());
// Should hide for touch events in the shelf.
- tooltip_manager_->ShowTooltip(shelf_->GetAppListButtonView());
+ tooltip_manager_->ShowTooltip(shelf_->GetAppListButton());
ASSERT_TRUE(tooltip_manager_->IsVisible());
generator.set_current_location(shelf_bounds.CenterPoint());
generator.PressTouch();
EXPECT_FALSE(tooltip_manager_->IsVisible());
// Should hide for gesture events in the shelf.
- tooltip_manager_->ShowTooltip(shelf_->GetAppListButtonView());
+ tooltip_manager_->ShowTooltip(shelf_->GetAppListButton());
ASSERT_TRUE(tooltip_manager_->IsVisible());
generator.GestureTapDownAndUp(shelf_bounds.CenterPoint());
EXPECT_FALSE(tooltip_manager_->IsVisible());
@@ -197,7 +198,7 @@ TEST_F(ShelfTooltipManagerTest, HideForExternalEvents) {
bool closes = shelf_window->GetRootWindow() == Shell::GetPrimaryRootWindow();
// Should hide for touches outside the shelf.
- tooltip_manager_->ShowTooltip(shelf_->GetAppListButtonView());
+ tooltip_manager_->ShowTooltip(shelf_->GetAppListButton());
ASSERT_TRUE(tooltip_manager_->IsVisible());
generator.set_current_location(gfx::Point());
generator.PressTouch();
@@ -205,7 +206,7 @@ TEST_F(ShelfTooltipManagerTest, HideForExternalEvents) {
generator.ReleaseTouch();
// Should hide for touch events on the tooltip.
- tooltip_manager_->ShowTooltip(shelf_->GetAppListButtonView());
+ tooltip_manager_->ShowTooltip(shelf_->GetAppListButton());
ASSERT_TRUE(tooltip_manager_->IsVisible());
generator.set_current_location(
GetTooltip()->GetWindowBoundsInScreen().CenterPoint());
@@ -214,7 +215,7 @@ TEST_F(ShelfTooltipManagerTest, HideForExternalEvents) {
generator.ReleaseTouch();
// Should hide for gestures outside the shelf.
- tooltip_manager_->ShowTooltip(shelf_->GetAppListButtonView());
+ tooltip_manager_->ShowTooltip(shelf_->GetAppListButton());
ASSERT_TRUE(tooltip_manager_->IsVisible());
generator.GestureTapDownAndUp(gfx::Point());
EXPECT_EQ(tooltip_manager_->IsVisible(), !closes);
@@ -224,7 +225,7 @@ TEST_F(ShelfTooltipManagerTest, DoNotHideForKeyEvents) {
ui::test::EventGenerator& generator = GetEventGenerator();
// Should not hide for key events.
- tooltip_manager_->ShowTooltip(shelf_->GetAppListButtonView());
+ tooltip_manager_->ShowTooltip(shelf_->GetAppListButton());
ASSERT_TRUE(tooltip_manager_->IsVisible());
generator.PressKey(ui::VKEY_A, ui::EF_NONE);
EXPECT_TRUE(tooltip_manager_->IsVisible());
« no previous file with comments | « ash/shelf/shelf_button.cc ('k') | ash/shelf/shelf_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698