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

Unified Diff: content/renderer/input/main_thread_event_queue_unittest.cc

Issue 2259823007: Add a unit test expection for calling the render scheduler on coalesced events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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
« no previous file with comments | « content/renderer/input/main_thread_event_queue.cc ('k') | third_party/WebKit/public/blink_headers.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/input/main_thread_event_queue_unittest.cc
diff --git a/content/renderer/input/main_thread_event_queue_unittest.cc b/content/renderer/input/main_thread_event_queue_unittest.cc
index 799325c54e6e3fcdad69748ea7a4a791233a0d26..d5036cfec1dbd991c21d2ef94518a6ef30f05c72 100644
--- a/content/renderer/input/main_thread_event_queue_unittest.cc
+++ b/content/renderer/input/main_thread_event_queue_unittest.cc
@@ -13,7 +13,9 @@
#include "build/build_config.h"
#include "content/common/input/synthetic_web_input_event_builders.h"
#include "content/renderer/input/main_thread_event_queue.h"
+#include "content/renderer/render_thread_impl.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/WebKit/public/platform/scheduler/test/mock_renderer_scheduler.h"
using blink::WebInputEvent;
using blink::WebMouseEvent;
@@ -41,9 +43,10 @@ class MainThreadEventQueueTest : public testing::Test,
public:
MainThreadEventQueueTest()
: main_task_runner_(new base::TestSimpleTaskRunner()),
- queue_(
- new MainThreadEventQueue(kTestRoutingID, this, main_task_runner_)) {
- }
+ queue_(new MainThreadEventQueue(kTestRoutingID,
+ this,
+ main_task_runner_,
+ &renderer_scheduler_)) {}
void HandleEventOnMainThread(int routing_id,
const blink::WebInputEvent* event,
@@ -84,6 +87,7 @@ class MainThreadEventQueueTest : public testing::Test,
protected:
scoped_refptr<base::TestSimpleTaskRunner> main_task_runner_;
+ blink::scheduler::MockRendererScheduler renderer_scheduler_;
scoped_refptr<MainThreadEventQueue> queue_;
std::vector<ui::ScopedWebInputEvent> handled_events_;
std::vector<uint32_t> additional_acked_events_;
@@ -192,6 +196,9 @@ TEST_F(MainThreadEventQueueTest, BlockingTouch) {
kEvents[2].MovePoint(0, 30, 30);
kEvents[3].PressPoint(10, 10);
kEvents[3].MovePoint(0, 35, 35);
+
+ EXPECT_CALL(renderer_scheduler_, DidHandleInputEventOnMainThread(testing::_))
+ .Times(2);
// Ensure that coalescing takes place.
HandleEvent(kEvents[0], INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING);
HandleEvent(kEvents[1], INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
« no previous file with comments | « content/renderer/input/main_thread_event_queue.cc ('k') | third_party/WebKit/public/blink_headers.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698