Commit 7185d9d3 authored by jonross's avatar jonross Committed by Commit bot

Remove the message loop wait that changes timing of tests on valgrind. None of...

Remove the message loop wait that changes timing of tests on valgrind. None of the tests are checking for delayed state changes, so the waits are unnecessary.

Remove the filter to test failures on the bots.

TEST=ShelfViewTest.AppListButtonTouchFeedback, ShelfViewTest.AppListButtonTouchFeedbackCancellation, SystemTrayTest.TrayPopupItemContainerTouchFeedback, SystemTrayTest.TrayPopupItemContainerTouchFeedbackCancellation, TrayDetailsViewTest.HoverHighlightViewTouchFeedback, TrayDetailsViewTest.HoverHighlightViewTouchFeedbackCancellation, TrayDetailsViewTest.TrayPopupHeaderButtonTouchFeedback, TrayDetailsViewTest.TrayPopupHeaderButtonTouchFeedbackCancellation, WebNotificationTrayTest.TouchFeedback, WebNotificationTrayTest.TouchFeedbackCancellation
BUG=421888

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

Cr-Commit-Position: refs/heads/master@{#319881}
parent 6a5a2468
......@@ -1663,7 +1663,7 @@ TEST_F(ShelfViewTest, CheckDragAndDropFromOverflowBubbleToShelf) {
}
// Tests that the AppListButton renders as active in response to touches.
TEST_F(ShelfViewTest, DISABLED_AppListButtonTouchFeedback) {
TEST_F(ShelfViewTest, AppListButtonTouchFeedback) {
AppListButton* app_list_button =
static_cast<AppListButton*>(shelf_view_->GetAppListButtonView());
EXPECT_FALSE(app_list_button->draw_background_as_active());
......@@ -1672,18 +1672,16 @@ TEST_F(ShelfViewTest, DISABLED_AppListButtonTouchFeedback) {
generator.set_current_location(app_list_button->
GetBoundsInScreen().CenterPoint());
generator.PressTouch();
RunAllPendingInMessageLoop();
EXPECT_TRUE(app_list_button->draw_background_as_active());
generator.ReleaseTouch();
RunAllPendingInMessageLoop();
EXPECT_FALSE(app_list_button->draw_background_as_active());
EXPECT_TRUE(Shell::GetInstance()->GetAppListTargetVisibility());
}
// Tests that a touch that slides out of the bounds of the AppListButton leads
// to the end of rendering an active state.
TEST_F(ShelfViewTest, DISABLED_AppListButtonTouchFeedbackCancellation) {
TEST_F(ShelfViewTest, AppListButtonTouchFeedbackCancellation) {
AppListButton* app_list_button =
static_cast<AppListButton*>(shelf_view_->GetAppListButtonView());
EXPECT_FALSE(app_list_button->draw_background_as_active());
......@@ -1692,19 +1690,16 @@ TEST_F(ShelfViewTest, DISABLED_AppListButtonTouchFeedbackCancellation) {
generator.set_current_location(app_list_button->
GetBoundsInScreen().CenterPoint());
generator.PressTouch();
RunAllPendingInMessageLoop();
EXPECT_TRUE(app_list_button->draw_background_as_active());
gfx::Point moved_point(app_list_button->GetBoundsInScreen().right() + 1,
app_list_button->
GetBoundsInScreen().CenterPoint().y());
generator.MoveTouch(moved_point);
RunAllPendingInMessageLoop();
EXPECT_FALSE(app_list_button->draw_background_as_active());
generator.set_current_location(moved_point);
generator.ReleaseTouch();
RunAllPendingInMessageLoop();
EXPECT_FALSE(app_list_button->draw_background_as_active());
EXPECT_FALSE(Shell::GetInstance()->GetAppListTargetVisibility());
}
......
......@@ -507,11 +507,9 @@ TEST_F(SystemTrayTest, TrayPopupItemContainerTouchFeedback) {
ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow());
generator.set_current_location(view->GetBoundsInScreen().CenterPoint());
generator.PressTouch();
RunAllPendingInMessageLoop();
EXPECT_TRUE(view->active());
generator.ReleaseTouch();
RunAllPendingInMessageLoop();
EXPECT_FALSE(view->active());
}
......@@ -530,17 +528,14 @@ TEST_F(SystemTrayTest, TrayPopupItemContainerTouchFeedbackCancellation) {
ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow());
generator.set_current_location(view_bounds.CenterPoint());
generator.PressTouch();
RunAllPendingInMessageLoop();
EXPECT_TRUE(view->active());
gfx::Point move_point(view_bounds.x(), view_bounds.CenterPoint().y());
generator.MoveTouch(move_point);
RunAllPendingInMessageLoop();
EXPECT_FALSE(view->active());
generator.set_current_location(move_point);
generator.ReleaseTouch();
RunAllPendingInMessageLoop();
EXPECT_FALSE(view->active());
}
#endif // OS_CHROMEOS
......
......@@ -201,11 +201,9 @@ TEST_F(TrayDetailsViewTest, HoverHighlightViewTouchFeedback) {
ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow());
generator.set_current_location(view->GetBoundsInScreen().CenterPoint());
generator.PressTouch();
RunAllPendingInMessageLoop();
EXPECT_TRUE(view->hover());
generator.ReleaseTouch();
RunAllPendingInMessageLoop();
EXPECT_FALSE(view->hover());
}
......@@ -218,17 +216,14 @@ TEST_F(TrayDetailsViewTest, HoverHighlightViewTouchFeedbackCancellation) {
ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow());
generator.set_current_location(view_bounds.CenterPoint());
generator.PressTouch();
RunAllPendingInMessageLoop();
EXPECT_TRUE(view->hover());
gfx::Point move_point(view_bounds.x(), view_bounds.CenterPoint().y());
generator.MoveTouch(move_point);
RunAllPendingInMessageLoop();
EXPECT_FALSE(view->hover());
generator.set_current_location(move_point);
generator.ReleaseTouch();
RunAllPendingInMessageLoop();
EXPECT_FALSE(view->hover());
}
......@@ -240,11 +235,9 @@ TEST_F(TrayDetailsViewTest, TrayPopupHeaderButtonTouchFeedback) {
ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow());
generator.set_current_location(button->GetBoundsInScreen().CenterPoint());
generator.PressTouch();
RunAllPendingInMessageLoop();
EXPECT_TRUE(button->background());
generator.ReleaseTouch();
RunAllPendingInMessageLoop();
EXPECT_FALSE(button->background());
}
......@@ -258,17 +251,14 @@ TEST_F(TrayDetailsViewTest, TrayPopupHeaderButtonTouchFeedbackCancellation) {
ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow());
generator.set_current_location(view_bounds.CenterPoint());
generator.PressTouch();
RunAllPendingInMessageLoop();
EXPECT_TRUE(button->background());
gfx::Point move_point(view_bounds.x(), view_bounds.CenterPoint().y());
generator.MoveTouch(move_point);
RunAllPendingInMessageLoop();
EXPECT_FALSE(button->background());
generator.set_current_location(move_point);
generator.ReleaseTouch();
RunAllPendingInMessageLoop();
EXPECT_FALSE(button->background());
}
......
......@@ -469,14 +469,12 @@ TEST_F(WebNotificationTrayTest, MAYBE_PopupAndSystemTrayMultiDisplay) {
EXPECT_EQ(bottom_second, GetPopupWorkAreaBottomForTray(GetSecondaryTray()));
}
// TODO(jonross): This test is failing on ASAN bots, fix the failure and
// re-enable. (crbug.com/411881)
// TODO(jonross): Replace manually creating TouchEvent with
// EventGenerator.PressTouch/ReleaseTouch. Currently they set a width on the
// touch event causing the gesture recognizer to target a different view.
#if defined(OS_CHROMEOS)
// Tests that there is visual feedback for touch presses.
TEST_F(WebNotificationTrayTest, DISABLED_TouchFeedback) {
TEST_F(WebNotificationTrayTest, TouchFeedback) {
AddNotification("test_id");
RunAllPendingInMessageLoop();
WebNotificationTray* tray = GetTray();
......@@ -489,27 +487,22 @@ TEST_F(WebNotificationTrayTest, DISABLED_TouchFeedback) {
ui::TouchEvent press(ui::ET_TOUCH_PRESSED, center_point, touch_id,
generator.Now());
generator.Dispatch(&press);
RunAllPendingInMessageLoop();
EXPECT_TRUE(tray->draw_background_as_active());
ui::TouchEvent release(ui::ET_TOUCH_RELEASED, center_point, touch_id,
press.time_stamp() + base::TimeDelta::FromMilliseconds(50));
generator.Dispatch(&release);
RunAllPendingInMessageLoop();
EXPECT_TRUE(tray->draw_background_as_active());
EXPECT_TRUE(tray->IsMessageCenterBubbleVisible());
generator.GestureTapAt(center_point);
RunAllPendingInMessageLoop();
EXPECT_FALSE(tray->draw_background_as_active());
EXPECT_FALSE(tray->IsMessageCenterBubbleVisible());
}
// TODO(jonross): This test is failing on ASAN bots, fix the failure and
// re-enable. (crbug.com/411881)
// Tests that while touch presses trigger visual feedback, that subsequent non
// tap gestures cancel the feedback without triggering the message center.
TEST_F(WebNotificationTrayTest, DISABLED_TouchFeedbackCancellation) {
TEST_F(WebNotificationTrayTest, TouchFeedbackCancellation) {
AddNotification("test_id");
RunAllPendingInMessageLoop();
WebNotificationTray* tray = GetTray();
......@@ -523,20 +516,17 @@ TEST_F(WebNotificationTrayTest, DISABLED_TouchFeedbackCancellation) {
ui::TouchEvent press(ui::ET_TOUCH_PRESSED, center_point, touch_id,
generator.Now());
generator.Dispatch(&press);
RunAllPendingInMessageLoop();
EXPECT_TRUE(tray->draw_background_as_active());
gfx::Point out_of_bounds(bounds.x() - 1, center_point.y());
ui::TouchEvent move(ui::ET_TOUCH_MOVED, out_of_bounds, touch_id,
press.time_stamp()+base::TimeDelta::FromMilliseconds(50));
generator.Dispatch(&move);
RunAllPendingInMessageLoop();
EXPECT_FALSE(tray->draw_background_as_active());
ui::TouchEvent release(ui::ET_TOUCH_RELEASED, out_of_bounds, touch_id,
move.time_stamp()+base::TimeDelta::FromMilliseconds(50));
generator.Dispatch(&release);
RunAllPendingInMessageLoop();
EXPECT_FALSE(tray->draw_background_as_active());
EXPECT_FALSE(tray->IsMessageCenterBubbleVisible());
}
......
......@@ -134,9 +134,14 @@ void AshTestBase::SetUp() {
Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000));
ash::Shell::GetInstance()->cursor_manager()->EnableMouseEvents();
// Changing GestureConfiguration shouldn't make tests fail.
ui::GestureConfiguration::GetInstance()
->set_max_touch_move_in_pixels_for_click(5);
// Changing GestureConfiguration shouldn't make tests fail. These values
// prevent unexpected events from being generated during tests. Such as
// delayed events which create race conditions on slower tests.
ui::GestureConfiguration* gesture_config =
ui::GestureConfiguration::GetInstance();
gesture_config->set_max_touch_down_duration_for_click_in_ms(800);
gesture_config->set_long_press_time_in_ms(1000);
gesture_config->set_max_touch_move_in_pixels_for_click(5);
#if defined(OS_WIN)
if (!command_line->HasSwitch(ash::switches::kForceAshToDesktop)) {
......
......@@ -4,6 +4,3 @@ AutoclickTest.UserInputCancelsAutoclick
AutoclickTest.SynthesizedMouseMovesIgnored
# http://crbug.com/383384
SystemGestureEventFilterTest.TwoFingerDragDelayed
# http://crbug.com/421888
SystemTrayTest.*TouchFeedback*
TrayDetailsViewTest.*TouchFeedback*
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