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

Unified Diff: ui/events/test/test_event_processor.cc

Issue 552503003: Introduce EventProcessor::OnEventProcessingStarted() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tests added, CL for review Created 6 years, 3 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/events/test/test_event_processor.cc
diff --git a/ui/events/test/test_event_processor.cc b/ui/events/test/test_event_processor.cc
index 86d4e44095f3837d835fb7a928eb85ef467d84cb..ec703470d0543ac1a385eabc0642f2c8a01e3add 100644
--- a/ui/events/test/test_event_processor.cc
+++ b/ui/events/test/test_event_processor.cc
@@ -9,14 +9,25 @@
namespace ui {
namespace test {
-TestEventProcessor::TestEventProcessor() : num_times_processing_finished_(0) {}
+TestEventProcessor::TestEventProcessor()
+ : should_processing_occur_(true),
+ num_times_processing_started_(0),
+ num_times_processing_finished_(0) {
+}
+
TestEventProcessor::~TestEventProcessor() {}
void TestEventProcessor::SetRoot(scoped_ptr<EventTarget> root) {
root_ = root.Pass();
}
-void TestEventProcessor::ResetCounts() {
+void TestEventProcessor::SetShouldProcessingOccur(bool occur) {
+ should_processing_occur_ = occur;
+}
+
+void TestEventProcessor::Reset() {
+ should_processing_occur_ = true;
+ num_times_processing_started_ = 0;
num_times_processing_finished_ = 0;
}
@@ -32,6 +43,11 @@ EventDispatchDetails TestEventProcessor::OnEventFromSource(Event* event) {
return EventProcessor::OnEventFromSource(event);
}
+bool TestEventProcessor::OnEventProcessingStarted(Event* event) {
+ num_times_processing_started_++;
+ return should_processing_occur_;
+}
+
void TestEventProcessor::OnEventProcessingFinished(Event* event) {
num_times_processing_finished_++;
}

Powered by Google App Engine
This is Rietveld 408576698