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

Side by Side Diff: content/browser/renderer_host/input/composited_scrolling_browsertest.cc

Issue 1749343004: Implement Wheel Gesture Scrolling on OSX. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ensure only high precision scroll begins are used Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <utility> 5 #include <utility>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 runner_->Quit(); 77 runner_->Quit();
78 } 78 }
79 79
80 protected: 80 protected:
81 void LoadURL() { 81 void LoadURL() {
82 const GURL data_url(kCompositedScrollingDataURL); 82 const GURL data_url(kCompositedScrollingDataURL);
83 NavigateToURL(shell(), data_url); 83 NavigateToURL(shell(), data_url);
84 84
85 RenderWidgetHostImpl* host = GetWidgetHost(); 85 RenderWidgetHostImpl* host = GetWidgetHost();
86 scoped_refptr<FrameWatcher> frame_watcher(new FrameWatcher()); 86 scoped_refptr<FrameWatcher> frame_watcher(new FrameWatcher());
87 host->GetProcess()->AddFilter(frame_watcher.get()); 87 frame_watcher->AttachTo(shell()->web_contents());
88 host->GetView()->SetSize(gfx::Size(400, 400)); 88 host->GetView()->SetSize(gfx::Size(400, 400));
89 89
90 base::string16 ready_title(base::ASCIIToUTF16("ready")); 90 base::string16 ready_title(base::ASCIIToUTF16("ready"));
91 TitleWatcher watcher(shell()->web_contents(), ready_title); 91 TitleWatcher watcher(shell()->web_contents(), ready_title);
92 ignore_result(watcher.WaitAndGetTitle()); 92 ignore_result(watcher.WaitAndGetTitle());
93 93
94 // We need to wait until at least one frame has been composited 94 // We need to wait until at least one frame has been composited
95 // otherwise the injection of the synthetic gestures may get 95 // otherwise the injection of the synthetic gestures may get
96 // dropped because of MainThread/Impl thread sync of touch event 96 // dropped because of MainThread/Impl thread sync of touch event
97 // regions. 97 // regions.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 MAYBE_Scroll3DTransformedScroller) { 162 MAYBE_Scroll3DTransformedScroller) {
163 LoadURL(); 163 LoadURL();
164 int scrollDistance = 164 int scrollDistance =
165 DoTouchScroll(gfx::Point(50, 150), gfx::Vector2d(0, 100)); 165 DoTouchScroll(gfx::Point(50, 150), gfx::Vector2d(0, 100));
166 // The scroll distance is increased due to the rotation of the scroller. 166 // The scroll distance is increased due to the rotation of the scroller.
167 EXPECT_EQ(std::floor(100 / std::cos(cc::MathUtil::Deg2Rad(30.f))) - 1, 167 EXPECT_EQ(std::floor(100 / std::cos(cc::MathUtil::Deg2Rad(30.f))) - 1,
168 scrollDistance); 168 scrollDistance);
169 } 169 }
170 170
171 } // namespace content 171 } // namespace content
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | content/browser/renderer_host/input/mouse_wheel_event_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698