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

Side by Side Diff: ui/events/ozone/evdev/touch_noise/touch_noise_finder_unittest.cc

Issue 1975533002: Change ui::Event::time_stamp from TimeDelta to TimeTicks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/events/ozone/evdev/touch_noise/touch_noise_finder.h" 5 #include "ui/events/ozone/evdev/touch_noise/touch_noise_finder.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 30 matching lines...) Expand all
41 InProgressTouchEvdev touch; 41 InProgressTouchEvdev touch;
42 touch.x = entry.location.x(); 42 touch.x = entry.location.x();
43 touch.y = entry.location.y(); 43 touch.y = entry.location.y();
44 touch.tracking_id = entry.slot; 44 touch.tracking_id = entry.slot;
45 touch.slot = entry.slot; 45 touch.slot = entry.slot;
46 touch.was_touching = was_touching.test(touch.slot); 46 touch.was_touching = was_touching.test(touch.slot);
47 touch.touching = entry.touching; 47 touch.touching = entry.touching;
48 touches.push_back(touch); 48 touches.push_back(touch);
49 49
50 if (i == count - 1 || entry.time_ms != entries[i + 1].time_ms) { 50 if (i == count - 1 || entry.time_ms != entries[i + 1].time_ms) {
51 touch_noise_finder_->HandleTouches( 51 touch_noise_finder_->HandleTouches(touches, base::TimeTicks() +
52 touches, base::TimeDelta::FromMilliseconds(entry.time_ms)); 52 base::TimeDelta::FromMilliseconds(entry.time_ms));
53 53
54 for (size_t j = 0; j < touches.size(); ++j) { 54 for (size_t j = 0; j < touches.size(); ++j) {
55 bool expect_noise = entries[j + start_index].expect_noise; 55 bool expect_noise = entries[j + start_index].expect_noise;
56 size_t slot = touches[j].slot; 56 size_t slot = touches[j].slot;
57 if (touch_noise_finder_->SlotHasNoise(slot) != expect_noise) { 57 if (touch_noise_finder_->SlotHasNoise(slot) != expect_noise) {
58 LOG(ERROR) << base::StringPrintf( 58 LOG(ERROR) << base::StringPrintf(
59 "Incorrect filtering at %dms for slot %zu", entry.time_ms, 59 "Incorrect filtering at %dms for slot %zu", entry.time_ms,
60 slot); 60 slot);
61 return false; 61 return false;
62 } 62 }
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 {1000, 1, true, gfx::PointF(10, 10), false}, 148 {1000, 1, true, gfx::PointF(10, 10), false},
149 {2000, 1, true, gfx::PointF(10, 11), false}, 149 {2000, 1, true, gfx::PointF(10, 11), false},
150 {3000, 1, true, gfx::PointF(10, 10), false}, 150 {3000, 1, true, gfx::PointF(10, 10), false},
151 {4000, 1, true, gfx::PointF(10, 11), true}, 151 {4000, 1, true, gfx::PointF(10, 11), true},
152 {5000, 1, true, gfx::PointF(10, 10), true}, 152 {5000, 1, true, gfx::PointF(10, 10), true},
153 {6000, 1, true, gfx::PointF(10, 11), true}}; 153 {6000, 1, true, gfx::PointF(10, 11), true}};
154 EXPECT_TRUE(FilterAndCheck(kTestData, arraysize(kTestData))); 154 EXPECT_TRUE(FilterAndCheck(kTestData, arraysize(kTestData)));
155 } 155 }
156 156
157 } // namespace ui 157 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/touch_noise/touch_noise_finder.cc ('k') | ui/events/test/event_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698