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

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

Issue 217163006: Defer synthetic gesture completions until events have been flushed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restore browser test Created 6 years, 8 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 "base/auto_reset.h" 5 #include "base/auto_reset.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "content/browser/renderer_host/input/synthetic_gesture.h" 10 #include "content/browser/renderer_host/input/synthetic_gesture.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 if (TouchEventQueue::TOUCH_SCROLLING_MODE_DEFAULT == 182 if (TouchEventQueue::TOUCH_SCROLLING_MODE_DEFAULT ==
183 TouchEventQueue::TOUCH_SCROLLING_MODE_TOUCHCANCEL) { 183 TouchEventQueue::TOUCH_SCROLLING_MODE_TOUCHCANCEL) {
184 EXPECT_EQ(0, ExecuteScriptAndExtractInt("eventCounts.touchend")); 184 EXPECT_EQ(0, ExecuteScriptAndExtractInt("eventCounts.touchend"));
185 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchcancel")); 185 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchcancel"));
186 } else { 186 } else {
187 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchend")); 187 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchend"));
188 EXPECT_EQ(0, ExecuteScriptAndExtractInt("eventCounts.touchcancel")); 188 EXPECT_EQ(0, ExecuteScriptAndExtractInt("eventCounts.touchcancel"));
189 } 189 }
190 } 190 }
191 191
192 // TouchActionBrowserTest.TouchActionNone fails under ThreadSanitizer v2,
193 // see http://crbug.com/357505.
194 #if defined(THREAD_SANITIZER)
195 #define MAYBE_TouchActionNone DISABLED_TouchActionNone
196 #else
197 #define MAYBE_TouchActionNone TouchActionNone
198 #endif
199 // Verify that touching a touch-action: none region disables scrolling and 192 // Verify that touching a touch-action: none region disables scrolling and
200 // enables all touch events to be sent. 193 // enables all touch events to be sent.
201 IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, MAYBE_TouchActionNone) { 194 IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, TouchActionNone) {
202 LoadURL(); 195 LoadURL();
203 196
204 bool scrolled = DoTouchScroll(gfx::Point(50, 150), gfx::Vector2d(0, 45)); 197 bool scrolled = DoTouchScroll(gfx::Point(50, 150), gfx::Vector2d(0, 45));
205 EXPECT_FALSE(scrolled); 198 EXPECT_FALSE(scrolled);
206 199
207 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchstart")); 200 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchstart"));
208 EXPECT_GT(ExecuteScriptAndExtractInt("eventCounts.touchmove"), 1); 201 EXPECT_GT(ExecuteScriptAndExtractInt("eventCounts.touchmove"), 1);
209 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchend")); 202 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchend"));
210 EXPECT_EQ(0, ExecuteScriptAndExtractInt("eventCounts.touchcancel")); 203 EXPECT_EQ(0, ExecuteScriptAndExtractInt("eventCounts.touchcancel"));
211 } 204 }
212 205
213 } // namespace content 206 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698