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

Unified Diff: content/browser/renderer_host/render_widget_host_unittest.cc

Issue 2725263002: Revert of Fix unit tests to enable them testing with the rAF aligned touch input. (Closed)
Patch Set: Created 3 years, 10 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: content/browser/renderer_host/render_widget_host_unittest.cc
diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc
index abdec429d1d6161410632ae5c537690f7a7e03af..972f34021b3a5ddaaa670a1a445ef43646e6fb07 100644
--- a/content/browser/renderer_host/render_widget_host_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_unittest.cc
@@ -14,7 +14,6 @@
#include "base/macros.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
-#include "base/test/scoped_feature_list.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/timer/timer.h"
#include "build/build_config.h"
@@ -27,7 +26,6 @@
#include "content/common/input_messages.h"
#include "content/common/resize_params.h"
#include "content/common/view_messages.h"
-#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/mock_render_process_host.h"
#include "content/public/test/test_browser_context.h"
@@ -468,8 +466,6 @@
void SetUp() override {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
command_line->AppendSwitch(switches::kValidateInputEventStream);
- feature_list_.InitFromCommandLine(
- features::kRafAlignedTouchInputEvents.name, "");
browser_context_.reset(new TestBrowserContext());
delegate_.reset(new MockRenderWidgetHostDelegate());
@@ -675,7 +671,6 @@
SyntheticWebTouchEvent touch_event_;
TestBrowserThreadBundle thread_bundle_;
- base::test::ScopedFeatureList feature_list_;
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostTest);
};
@@ -1309,8 +1304,7 @@
SimulateMouseEvent(WebInputEvent::MouseMove, 10, 30, 0, true);
EXPECT_EQ(WebInputEvent::TouchMove, host_->acked_touch_event_type());
EXPECT_EQ(
- "GestureTapCancel GestureScrollBegin TouchScrollStarted "
- "GestureScrollUpdate",
+ "GestureTapCancel GestureScrollBegin GestureScrollUpdate",
GetInputMessageTypes(process_));
SendInputEventACK(WebInputEvent::GestureScrollUpdate,
INPUT_EVENT_ACK_STATE_CONSUMED);
@@ -1368,8 +1362,7 @@
SimulateMouseEvent(WebInputEvent::MouseMove, 10, 100, 0, true);
EXPECT_EQ(WebInputEvent::TouchMove, host_->acked_touch_event_type());
EXPECT_EQ(
- "GestureTapCancel GestureScrollBegin TouchScrollStarted "
- "GestureScrollUpdate",
+ "GestureTapCancel GestureScrollBegin GestureScrollUpdate",
GetInputMessageTypes(process_));
SendInputEventACK(WebInputEvent::GestureScrollUpdate,
INPUT_EVENT_ACK_STATE_CONSUMED);
@@ -1423,8 +1416,7 @@
SimulateMouseEvent(WebInputEvent::MouseMove, 10, 30, 0, true);
EXPECT_EQ(WebInputEvent::TouchMove, host_->acked_touch_event_type());
EXPECT_EQ(
- "GestureTapCancel GestureScrollBegin TouchScrollStarted "
- "GestureScrollUpdate",
+ "GestureTapCancel GestureScrollBegin GestureScrollUpdate",
GetInputMessageTypes(process_));
SendInputEventACK(WebInputEvent::GestureScrollUpdate,
INPUT_EVENT_ACK_STATE_CONSUMED);
@@ -1620,34 +1612,6 @@
process->sink().ClearMessages();
}
-void CheckLatencyInfoComponentInGestureScrollUpdate(
- RenderWidgetHostProcess* process,
- int64_t component_id) {
- EXPECT_EQ(process->sink().message_count(), 2U);
- const IPC::Message* message = process->sink().GetMessageAt(0);
- EXPECT_EQ(InputMsg_HandleInputEvent::ID, message->type());
- InputMsg_HandleInputEvent::Param params;
- EXPECT_TRUE(InputMsg_HandleInputEvent::Read(message, &params));
-
- const WebInputEvent* event = std::get<0>(params);
- ui::LatencyInfo latency_info = std::get<2>(params);
-
- EXPECT_TRUE(event->type() == WebInputEvent::TouchScrollStarted);
-
- message = process->sink().GetMessageAt(1);
- EXPECT_EQ(InputMsg_HandleInputEvent::ID, message->type());
- EXPECT_TRUE(InputMsg_HandleInputEvent::Read(message, &params));
-
- event = std::get<0>(params);
- latency_info = std::get<2>(params);
-
- EXPECT_TRUE(event->type() == WebInputEvent::GestureScrollUpdate);
- EXPECT_TRUE(latency_info.FindLatency(
- ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, component_id, NULL));
-
- process->sink().ClearMessages();
-}
-
// Tests that after input event passes through RWHI through ForwardXXXEvent()
// or ForwardXXXEventWithLatencyInfo(), LatencyInfo component
// ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT will always present in the
@@ -1691,8 +1655,8 @@
SimulateGestureEventWithLatencyInfo(WebInputEvent::GestureScrollUpdate,
blink::WebGestureDeviceTouchscreen,
ui::LatencyInfo());
- CheckLatencyInfoComponentInGestureScrollUpdate(process_,
- GetLatencyComponentId());
+ CheckLatencyInfoComponentInMessage(
+ process_, GetLatencyComponentId(), WebInputEvent::GestureScrollUpdate);
SendInputEventACK(WebInputEvent::GestureScrollUpdate,
INPUT_EVENT_ACK_STATE_CONSUMED);

Powered by Google App Engine
This is Rietveld 408576698