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 <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 Loading... |
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 Loading... |
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 |
OLD | NEW |