Commit e8dbd426 authored by Rob Schonberger's avatar Rob Schonberger Committed by Commit Bot

Add a timer histogram for PalmDetectionFilter Filter time, and test it.

This adds a timer histogram for all PalmDetectionFilter->Filter
executions. We'll keep the timer whenever we change the underlying
filter implementation.

Adds a unit test that ensures the timer is populated.

Bug: 982118
Change-Id: I410ca0348bca9c556f4dff05ab5e228a1f09516d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1824796Reviewed-by: default avatarMichael Spang <spang@chromium.org>
Commit-Queue: Rob Schonberger <robsc@google.com>
Cr-Commit-Position: refs/heads/master@{#699983}
parent fde745d0
...@@ -553,7 +553,10 @@ void TouchEventConverterEvdev::ReportEvents(base::TimeTicks timestamp) { ...@@ -553,7 +553,10 @@ void TouchEventConverterEvdev::ReportEvents(base::TimeTicks timestamp) {
if (false_touch_finder_) if (false_touch_finder_)
false_touch_finder_->HandleTouches(events_, timestamp); false_touch_finder_->HandleTouches(events_, timestamp);
std::bitset<kNumTouchEvdevSlots> hold, suppress; std::bitset<kNumTouchEvdevSlots> hold, suppress;
palm_detection_filter_->Filter(events_, timestamp, &hold, &suppress); {
SCOPED_UMA_HISTOGRAM_TIMER(kPalmFilterTimerEventName);
palm_detection_filter_->Filter(events_, timestamp, &hold, &suppress);
}
for (size_t i = 0; i < events_.size(); i++) { for (size_t i = 0; i < events_.size(); i++) {
InProgressTouchEvdev* event = &events_[i]; InProgressTouchEvdev* event = &events_[i];
if (IsPalm(*event)) { if (IsPalm(*event)) {
...@@ -683,4 +686,6 @@ const char TouchEventConverterEvdev::kHoldCountAtReleaseEventName[] = ...@@ -683,4 +686,6 @@ const char TouchEventConverterEvdev::kHoldCountAtReleaseEventName[] =
"Ozone.TouchEventConverterEvdev.HoldCountAtRelease"; "Ozone.TouchEventConverterEvdev.HoldCountAtRelease";
const char TouchEventConverterEvdev::kHoldCountAtCancelEventName[] = const char TouchEventConverterEvdev::kHoldCountAtCancelEventName[] =
"Ozone.TouchEventConverterEvdev.HoldCountAtCancel"; "Ozone.TouchEventConverterEvdev.HoldCountAtCancel";
const char TouchEventConverterEvdev::kPalmFilterTimerEventName[] =
"Ozone.TouchEventConverterEvdev.PalmDetectionFilterTime";
} // namespace ui } // namespace ui
...@@ -70,6 +70,7 @@ class EVENTS_OZONE_EVDEV_EXPORT TouchEventConverterEvdev ...@@ -70,6 +70,7 @@ class EVENTS_OZONE_EVDEV_EXPORT TouchEventConverterEvdev
static const char kHoldCountAtReleaseEventName[]; static const char kHoldCountAtReleaseEventName[];
static const char kHoldCountAtCancelEventName[]; static const char kHoldCountAtCancelEventName[];
static const char kPalmFilterTimerEventName[];
private: private:
friend class MockTouchEventConverterEvdev; friend class MockTouchEventConverterEvdev;
......
...@@ -1628,6 +1628,9 @@ TEST_F(TouchEventConverterEvdevTest, HeldEventNotSent) { ...@@ -1628,6 +1628,9 @@ TEST_F(TouchEventConverterEvdevTest, HeldEventNotSent) {
EXPECT_THAT(histogram_tester_.GetAllSamples( EXPECT_THAT(histogram_tester_.GetAllSamples(
TouchEventConverterEvdev::kHoldCountAtCancelEventName), TouchEventConverterEvdev::kHoldCountAtCancelEventName),
testing::ElementsAre()); testing::ElementsAre());
EXPECT_THAT(histogram_tester_.GetAllSamples(
TouchEventConverterEvdev::kPalmFilterTimerEventName),
testing::SizeIs(1));
} }
TEST_F(TouchEventConverterEvdevTest, HeldThenEnd) { TEST_F(TouchEventConverterEvdevTest, HeldThenEnd) {
......
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