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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura_unittest.cc

Issue 510793003: Remove ui::TouchEvent -> blink::WebTouchEvent conversion methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests. Created 6 years 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/shared_memory.h" 9 #include "base/memory/shared_memory.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "base/run_loop.h" 11 #include "base/run_loop.h"
12 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
13 #include "cc/output/compositor_frame.h" 13 #include "cc/output/compositor_frame.h"
14 #include "cc/output/compositor_frame_metadata.h" 14 #include "cc/output/compositor_frame_metadata.h"
15 #include "cc/output/copy_output_request.h" 15 #include "cc/output/copy_output_request.h"
16 #include "cc/surfaces/surface.h" 16 #include "cc/surfaces/surface.h"
17 #include "cc/surfaces/surface_manager.h" 17 #include "cc/surfaces/surface_manager.h"
18 #include "content/browser/browser_thread_impl.h" 18 #include "content/browser/browser_thread_impl.h"
19 #include "content/browser/compositor/resize_lock.h" 19 #include "content/browser/compositor/resize_lock.h"
20 #include "content/browser/compositor/test/no_transport_image_transport_factory.h " 20 #include "content/browser/compositor/test/no_transport_image_transport_factory.h "
21 #include "content/browser/frame_host/render_widget_host_view_guest.h" 21 #include "content/browser/frame_host/render_widget_host_view_guest.h"
22 #include "content/browser/renderer_host/input/web_input_event_util.h"
22 #include "content/browser/renderer_host/overscroll_controller.h" 23 #include "content/browser/renderer_host/overscroll_controller.h"
23 #include "content/browser/renderer_host/overscroll_controller_delegate.h" 24 #include "content/browser/renderer_host/overscroll_controller_delegate.h"
24 #include "content/browser/renderer_host/render_widget_host_delegate.h" 25 #include "content/browser/renderer_host/render_widget_host_delegate.h"
25 #include "content/browser/renderer_host/render_widget_host_impl.h" 26 #include "content/browser/renderer_host/render_widget_host_impl.h"
26 #include "content/common/gpu/client/gl_helper.h" 27 #include "content/common/gpu/client/gl_helper.h"
27 #include "content/common/gpu/gpu_messages.h" 28 #include "content/common/gpu/gpu_messages.h"
28 #include "content/common/host_shared_bitmap_manager.h" 29 #include "content/common/host_shared_bitmap_manager.h"
29 #include "content/common/input/synthetic_web_input_event_builders.h" 30 #include "content/common/input/synthetic_web_input_event_builders.h"
30 #include "content/common/input_messages.h" 31 #include "content/common/input_messages.h"
31 #include "content/common/view_messages.h" 32 #include "content/common/view_messages.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 } 249 }
249 250
250 // A lock that doesn't actually do anything to the compositor, and does not 251 // A lock that doesn't actually do anything to the compositor, and does not
251 // time out. 252 // time out.
252 class FakeResizeLock : public ResizeLock { 253 class FakeResizeLock : public ResizeLock {
253 public: 254 public:
254 FakeResizeLock(const gfx::Size new_size, bool defer_compositor_lock) 255 FakeResizeLock(const gfx::Size new_size, bool defer_compositor_lock)
255 : ResizeLock(new_size, defer_compositor_lock) {} 256 : ResizeLock(new_size, defer_compositor_lock) {}
256 }; 257 };
257 258
259 void OnTouchEvent(ui::TouchEvent* event) override {
260 RenderWidgetHostViewAura::OnTouchEvent(event);
261 touch_event_ = CreateWebTouchEventFromMotionEvent(pointer_state());
262 }
263
258 bool has_resize_lock_; 264 bool has_resize_lock_;
259 gfx::Size last_frame_size_; 265 gfx::Size last_frame_size_;
260 scoped_ptr<cc::CopyOutputRequest> last_copy_request_; 266 scoped_ptr<cc::CopyOutputRequest> last_copy_request_;
267 blink::WebTouchEvent touch_event_;
261 }; 268 };
262 269
263 // A layout manager that always resizes a child to the root window size. 270 // A layout manager that always resizes a child to the root window size.
264 class FullscreenLayoutManager : public aura::LayoutManager { 271 class FullscreenLayoutManager : public aura::LayoutManager {
265 public: 272 public:
266 explicit FullscreenLayoutManager(aura::Window* owner) : owner_(owner) {} 273 explicit FullscreenLayoutManager(aura::Window* owner) : owner_(owner) {}
267 ~FullscreenLayoutManager() override {} 274 ~FullscreenLayoutManager() override {}
268 275
269 // Overridden from aura::LayoutManager: 276 // Overridden from aura::LayoutManager:
270 void OnWindowResized() override { 277 void OnWindowResized() override {
(...skipping 2692 matching lines...) Expand 10 before | Expand all | Expand 10 after
2963 view_->OnTouchEvent(&press); 2970 view_->OnTouchEvent(&press);
2964 view_->OnTouchEvent(&invalid_move); 2971 view_->OnTouchEvent(&invalid_move);
2965 // Valid press is handled asynchronously. 2972 // Valid press is handled asynchronously.
2966 EXPECT_TRUE(press.synchronous_handling_disabled()); 2973 EXPECT_TRUE(press.synchronous_handling_disabled());
2967 // Invalid move is handled synchronously, but is consumed. 2974 // Invalid move is handled synchronously, but is consumed.
2968 EXPECT_FALSE(invalid_move.synchronous_handling_disabled()); 2975 EXPECT_FALSE(invalid_move.synchronous_handling_disabled());
2969 EXPECT_TRUE(invalid_move.stopped_propagation()); 2976 EXPECT_TRUE(invalid_move.stopped_propagation());
2970 } 2977 }
2971 2978
2972 } // namespace content 2979 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698