| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 "</script>"; | 64 "</script>"; |
| 65 | 65 |
| 66 } // namespace | 66 } // namespace |
| 67 | 67 |
| 68 namespace content { | 68 namespace content { |
| 69 | 69 |
| 70 | 70 |
| 71 class TouchActionBrowserTest : public ContentBrowserTest { | 71 class TouchActionBrowserTest : public ContentBrowserTest { |
| 72 public: | 72 public: |
| 73 TouchActionBrowserTest() {} | 73 TouchActionBrowserTest() {} |
| 74 virtual ~TouchActionBrowserTest() {} | 74 ~TouchActionBrowserTest() override {} |
| 75 | 75 |
| 76 RenderWidgetHostImpl* GetWidgetHost() { | 76 RenderWidgetHostImpl* GetWidgetHost() { |
| 77 return RenderWidgetHostImpl::From(shell()->web_contents()-> | 77 return RenderWidgetHostImpl::From(shell()->web_contents()-> |
| 78 GetRenderViewHost()); | 78 GetRenderViewHost()); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void OnSyntheticGestureCompleted(SyntheticGesture::Result result) { | 81 void OnSyntheticGestureCompleted(SyntheticGesture::Result result) { |
| 82 EXPECT_EQ(SyntheticGesture::GESTURE_FINISHED, result); | 82 EXPECT_EQ(SyntheticGesture::GESTURE_FINISHED, result); |
| 83 runner_->Quit(); | 83 runner_->Quit(); |
| 84 } | 84 } |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 bool scrolled = DoTouchScroll(gfx::Point(50, 150), gfx::Vector2d(0, 45)); | 199 bool scrolled = DoTouchScroll(gfx::Point(50, 150), gfx::Vector2d(0, 45)); |
| 200 EXPECT_FALSE(scrolled); | 200 EXPECT_FALSE(scrolled); |
| 201 | 201 |
| 202 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchstart")); | 202 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchstart")); |
| 203 EXPECT_GT(ExecuteScriptAndExtractInt("eventCounts.touchmove"), 1); | 203 EXPECT_GT(ExecuteScriptAndExtractInt("eventCounts.touchmove"), 1); |
| 204 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchend")); | 204 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchend")); |
| 205 EXPECT_EQ(0, ExecuteScriptAndExtractInt("eventCounts.touchcancel")); | 205 EXPECT_EQ(0, ExecuteScriptAndExtractInt("eventCounts.touchcancel")); |
| 206 } | 206 } |
| 207 | 207 |
| 208 } // namespace content | 208 } // namespace content |
| OLD | NEW |