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

Side by Side Diff: content/browser/renderer_host/input/touch_action_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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 runner_->Quit(); 87 runner_->Quit();
88 } 88 }
89 89
90 protected: 90 protected:
91 void LoadURL() { 91 void LoadURL() {
92 const GURL data_url(kTouchActionDataURL); 92 const GURL data_url(kTouchActionDataURL);
93 NavigateToURL(shell(), data_url); 93 NavigateToURL(shell(), data_url);
94 94
95 RenderWidgetHostImpl* host = GetWidgetHost(); 95 RenderWidgetHostImpl* host = GetWidgetHost();
96 scoped_refptr<FrameWatcher> frame_watcher(new FrameWatcher()); 96 scoped_refptr<FrameWatcher> frame_watcher(new FrameWatcher());
97 host->GetProcess()->AddFilter(frame_watcher.get()); 97 frame_watcher->AttachTo(shell()->web_contents());
98 host->GetView()->SetSize(gfx::Size(400, 400)); 98 host->GetView()->SetSize(gfx::Size(400, 400));
99 99
100 base::string16 ready_title(base::ASCIIToUTF16("ready")); 100 base::string16 ready_title(base::ASCIIToUTF16("ready"));
101 TitleWatcher watcher(shell()->web_contents(), ready_title); 101 TitleWatcher watcher(shell()->web_contents(), ready_title);
102 ignore_result(watcher.WaitAndGetTitle()); 102 ignore_result(watcher.WaitAndGetTitle());
103 103
104 // We need to wait until at least one frame has been composited 104 // We need to wait until at least one frame has been composited
105 // otherwise the injection of the synthetic gestures may get 105 // otherwise the injection of the synthetic gestures may get
106 // dropped because of MainThread/Impl thread sync of touch event 106 // dropped because of MainThread/Impl thread sync of touch event
107 // regions. 107 // regions.
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 bool scrolled = DoTouchScroll(gfx::Point(50, 150), gfx::Vector2d(0, 45)); 207 bool scrolled = DoTouchScroll(gfx::Point(50, 150), gfx::Vector2d(0, 45));
208 EXPECT_FALSE(scrolled); 208 EXPECT_FALSE(scrolled);
209 209
210 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchstart")); 210 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchstart"));
211 EXPECT_GE(ExecuteScriptAndExtractInt("eventCounts.touchmove"), 1); 211 EXPECT_GE(ExecuteScriptAndExtractInt("eventCounts.touchmove"), 1);
212 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchend")); 212 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchend"));
213 EXPECT_EQ(0, ExecuteScriptAndExtractInt("eventCounts.touchcancel")); 213 EXPECT_EQ(0, ExecuteScriptAndExtractInt("eventCounts.touchcancel"));
214 } 214 }
215 215
216 } // namespace content 216 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698