| OLD | NEW |
| 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 Loading... |
| 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 |
| 192 // Verify that touching a touch-action: none region disables scrolling and | 199 // Verify that touching a touch-action: none region disables scrolling and |
| 193 // enables all touch events to be sent. | 200 // enables all touch events to be sent. |
| 194 IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, TouchActionNone) { | 201 IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, MAYBE_TouchActionNone) { |
| 195 LoadURL(); | 202 LoadURL(); |
| 196 | 203 |
| 197 bool scrolled = DoTouchScroll(gfx::Point(50, 150), gfx::Vector2d(0, 45)); | 204 bool scrolled = DoTouchScroll(gfx::Point(50, 150), gfx::Vector2d(0, 45)); |
| 198 EXPECT_FALSE(scrolled); | 205 EXPECT_FALSE(scrolled); |
| 199 | 206 |
| 200 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchstart")); | 207 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchstart")); |
| 201 EXPECT_GT(ExecuteScriptAndExtractInt("eventCounts.touchmove"), 1); | 208 EXPECT_GT(ExecuteScriptAndExtractInt("eventCounts.touchmove"), 1); |
| 202 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchend")); | 209 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchend")); |
| 203 EXPECT_EQ(0, ExecuteScriptAndExtractInt("eventCounts.touchcancel")); | 210 EXPECT_EQ(0, ExecuteScriptAndExtractInt("eventCounts.touchcancel")); |
| 204 } | 211 } |
| 205 | 212 |
| 206 } // namespace content | 213 } // namespace content |
| OLD | NEW |