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

Unified Diff: ui/chromeos/touch_exploration_controller.cc

Issue 358693004: Added touch event permutations test to touch_exploration_controller. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@new_passthrough
Patch Set: updated NOTREACHED() logging and prevented the test from reaching the NOTREACHED() Created 6 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
Index: ui/chromeos/touch_exploration_controller.cc
diff --git a/ui/chromeos/touch_exploration_controller.cc b/ui/chromeos/touch_exploration_controller.cc
index 31e1a3a8324945c3f0a2c862ba9491d1f77304c8..290eae0e38e801295c76cb7132bd20d86d925d3f 100644
--- a/ui/chromeos/touch_exploration_controller.cc
+++ b/ui/chromeos/touch_exploration_controller.cc
@@ -54,8 +54,8 @@ ui::EventRewriteStatus TouchExplorationController::RewriteEvent(
if (!event.IsTouchEvent()) {
if (event.IsKeyEvent()) {
const ui::KeyEvent& key_event = static_cast<const ui::KeyEvent&>(event);
- VLOG(0) << "\nKeyboard event: " << key_event.name() << "\n"
- << " Key code: " << key_event.key_code()
+ VLOG(0) << "\nKeyboard event: " << key_event.name()
+ << "\n Key code: " << key_event.key_code()
<< ", Flags: " << key_event.flags()
<< ", Is char: " << key_event.is_char();
}
@@ -156,7 +156,7 @@ ui::EventRewriteStatus TouchExplorationController::InNoFingersDown(
VLOG_STATE();
return ui::EVENT_REWRITE_DISCARD;
}
- NOTREACHED() << "Unexpected event type received.";
+ NOTREACHED() << "Unexpected event type received: " << event.name();;
return ui::EVENT_REWRITE_CONTINUE;
}
@@ -196,7 +196,7 @@ ui::EventRewriteStatus TouchExplorationController::InSingleTapPressed(
}
return EVENT_REWRITE_DISCARD;
}
- NOTREACHED() << "Unexpected event type received.";
+ NOTREACHED() << "Unexpected event type received: " << event.name();;
return ui::EVENT_REWRITE_CONTINUE;
}
@@ -228,8 +228,12 @@ TouchExplorationController::InSingleTapOrTouchExploreReleased(
state_ = NO_FINGERS_DOWN;
}
return ui::EVENT_REWRITE_DISCARD;
+ } else if (type == ui::ET_TOUCH_MOVED){
+ LOG(WARNING) << "TOUCH_MOVED in InSingleTapOrTouchExploreReleased"
+ << " though there should not be any fingers down.";
+ return ui::EVENT_REWRITE_DISCARD;
}
- NOTREACHED() << "Unexpected event type received.";;
+ NOTREACHED() << "Unexpected event type received: " << event.name();
return ui::EVENT_REWRITE_CONTINUE;
}
@@ -255,7 +259,7 @@ ui::EventRewriteStatus TouchExplorationController::InDoubleTapPressed(
} else if (type == ui::ET_TOUCH_MOVED) {
return ui::EVENT_REWRITE_DISCARD;
}
- NOTREACHED() << "Unexpected event type received.";
+ NOTREACHED() << "Unexpected event type received: " << event.name();
return ui::EVENT_REWRITE_CONTINUE;
}
@@ -286,7 +290,7 @@ ui::EventRewriteStatus TouchExplorationController::InTouchExploration(
state_ = TOUCH_EXPLORE_RELEASED;
VLOG_STATE();
} else if (type != ui::ET_TOUCH_MOVED) {
- NOTREACHED() << "Unexpected event type received.";
+ NOTREACHED() << "Unexpected event type received: " << event.name();
return ui::EVENT_REWRITE_CONTINUE;
}
@@ -352,7 +356,7 @@ ui::EventRewriteStatus TouchExplorationController::InTwoToOneFinger(
return ui::EVENT_REWRITE_REWRITTEN;
}
}
- NOTREACHED() << "Unexpected event type received";
+ NOTREACHED() << "Unexpected event type received: " << event.name();
return ui::EVENT_REWRITE_CONTINUE;
}
@@ -363,7 +367,7 @@ ui::EventRewriteStatus TouchExplorationController::InPassthrough(
if (!(type == ui::ET_TOUCH_RELEASED || type == ui::ET_TOUCH_CANCELLED ||
type == ui::ET_TOUCH_MOVED || type == ui::ET_TOUCH_PRESSED)) {
- NOTREACHED() << "Unexpected event type received.";
+ NOTREACHED() << "Unexpected event type received: " << event.name();
return ui::EVENT_REWRITE_CONTINUE;
}
@@ -415,7 +419,7 @@ ui::EventRewriteStatus TouchExplorationController::InTouchExploreSecondPress(
VLOG_STATE();
return ui::EVENT_REWRITE_REWRITTEN;
}
- NOTREACHED() << "Unexpected event type received.";
+ NOTREACHED() << "Unexpected event type received: " << event.name();
return ui::EVENT_REWRITE_CONTINUE;
}
@@ -425,7 +429,7 @@ ui::EventRewriteStatus TouchExplorationController::InWaitForRelease(
ui::EventType type = event.type();
if (!(type == ui::ET_TOUCH_PRESSED || type == ui::ET_TOUCH_MOVED ||
type == ui::ET_TOUCH_RELEASED || type == ui::ET_TOUCH_CANCELLED)) {
- NOTREACHED() << "Unexpected event type received.";
+ NOTREACHED() << "Unexpected event type received: " << event.name();
return ui::EVENT_REWRITE_CONTINUE;
}
if (current_touch_ids_.size() == 0) {

Powered by Google App Engine
This is Rietveld 408576698