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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 // Verify that touching a touch-action: none region disables scrolling and | 192 // Verify that touching a touch-action: none region disables scrolling and |
193 // enables all touch events to be sent. | 193 // enables all touch events to be sent. |
194 // Disabled on MacOS because it doesn't support touch input. | 194 // Disabled on MacOS because it doesn't support touch input. |
195 #if defined(OS_MACOSX) | 195 // Flaky on OS_CHROMEOS crbug/376695. |
| 196 #if defined(OS_MACOSX) || defined(OS_CHROMEOS) |
196 #define MAYBE_TouchActionNone DISABLED_TouchActionNone | 197 #define MAYBE_TouchActionNone DISABLED_TouchActionNone |
197 #else | 198 #else |
198 #define MAYBE_TouchActionNone TouchActionNone | 199 #define MAYBE_TouchActionNone TouchActionNone |
199 #endif | 200 #endif |
200 IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, MAYBE_TouchActionNone) { | 201 IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, MAYBE_TouchActionNone) { |
201 LoadURL(); | 202 LoadURL(); |
202 | 203 |
203 bool scrolled = DoTouchScroll(gfx::Point(50, 150), gfx::Vector2d(0, 45)); | 204 bool scrolled = DoTouchScroll(gfx::Point(50, 150), gfx::Vector2d(0, 45)); |
204 EXPECT_FALSE(scrolled); | 205 EXPECT_FALSE(scrolled); |
205 | 206 |
206 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchstart")); | 207 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchstart")); |
207 EXPECT_GT(ExecuteScriptAndExtractInt("eventCounts.touchmove"), 1); | 208 EXPECT_GT(ExecuteScriptAndExtractInt("eventCounts.touchmove"), 1); |
208 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchend")); | 209 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchend")); |
209 EXPECT_EQ(0, ExecuteScriptAndExtractInt("eventCounts.touchcancel")); | 210 EXPECT_EQ(0, ExecuteScriptAndExtractInt("eventCounts.touchcancel")); |
210 } | 211 } |
211 | 212 |
212 } // namespace content | 213 } // namespace content |
OLD | NEW |