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..dcf57bd1d36f259c4b5296b2812173db3e99871f 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) { |
sadrul
2014/09/25 16:12:01
set_should_processing_occur()?
tdanderson
2014/09/25 17:11:58
Done.
|
+ should_processing_occur_ = occur; |
+} |
+ |
+void TestEventProcessor::Reset() { |
+ should_processing_occur_ = true; |
+ num_times_processing_started_ = 0; |
num_times_processing_finished_ = 0; |
} |
@@ -32,6 +43,12 @@ EventDispatchDetails TestEventProcessor::OnEventFromSource(Event* event) { |
return EventProcessor::OnEventFromSource(event); |
} |
+void TestEventProcessor::OnEventProcessingStarted(Event* event) { |
+ num_times_processing_started_++; |
+ if (!should_processing_occur_) |
+ event->SetHandled(); |
+} |
+ |
void TestEventProcessor::OnEventProcessingFinished(Event* event) { |
num_times_processing_finished_++; |
} |