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

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

Issue 2467913002: Touch event flag should control only DOM event firing. (Closed)
Patch Set: Merge branch 'master' of https://chromium.googlesource.com/chromium/src into patchtoflags Created 4 years, 1 month 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 <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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
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.
108 frame_watcher->WaitFrames(1); 108 frame_watcher->WaitFrames(1);
109 } 109 }
110 110
111 // ContentBrowserTest: 111 // ContentBrowserTest:
112 void SetUpCommandLine(base::CommandLine* cmd) override { 112 void SetUpCommandLine(base::CommandLine* cmd) override {
113 cmd->AppendSwitchASCII(switches::kTouchEvents,
114 switches::kTouchEventsEnabled);
115 // TODO(rbyers): Remove this switch once touch-action ships. 113 // TODO(rbyers): Remove this switch once touch-action ships.
116 // http://crbug.com/241964 114 // http://crbug.com/241964
117 cmd->AppendSwitch(switches::kEnableExperimentalWebPlatformFeatures); 115 cmd->AppendSwitch(switches::kEnableExperimentalWebPlatformFeatures);
118 } 116 }
119 117
120 int ExecuteScriptAndExtractInt(const std::string& script) { 118 int ExecuteScriptAndExtractInt(const std::string& script) {
121 int value = 0; 119 int value = 0;
122 EXPECT_TRUE(content::ExecuteScriptAndExtractInt( 120 EXPECT_TRUE(content::ExecuteScriptAndExtractInt(
123 shell(), "domAutomationController.send(" + script + ")", &value)); 121 shell(), "domAutomationController.send(" + script + ")", &value));
124 return value; 122 return value;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 DoTouchScroll(gfx::Point(50, 150), gfx::Vector2d(0, 45), false); 217 DoTouchScroll(gfx::Point(50, 150), gfx::Vector2d(0, 45), false);
220 EXPECT_FALSE(scrolled); 218 EXPECT_FALSE(scrolled);
221 219
222 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchstart")); 220 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchstart"));
223 EXPECT_GE(ExecuteScriptAndExtractInt("eventCounts.touchmove"), 1); 221 EXPECT_GE(ExecuteScriptAndExtractInt("eventCounts.touchmove"), 1);
224 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchend")); 222 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchend"));
225 EXPECT_EQ(0, ExecuteScriptAndExtractInt("eventCounts.touchcancel")); 223 EXPECT_EQ(0, ExecuteScriptAndExtractInt("eventCounts.touchcancel"));
226 } 224 }
227 225
228 } // namespace content 226 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698