| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 host->GetView()->SetSize(gfx::Size(400, 400)); | 102 host->GetView()->SetSize(gfx::Size(400, 400)); |
| 103 | 103 |
| 104 base::string16 ready_title(base::ASCIIToUTF16("ready")); | 104 base::string16 ready_title(base::ASCIIToUTF16("ready")); |
| 105 TitleWatcher watcher(shell()->web_contents(), ready_title); | 105 TitleWatcher watcher(shell()->web_contents(), ready_title); |
| 106 ignore_result(watcher.WaitAndGetTitle()); | 106 ignore_result(watcher.WaitAndGetTitle()); |
| 107 | 107 |
| 108 MainThreadFrameObserver main_thread_sync(host); | 108 MainThreadFrameObserver main_thread_sync(host); |
| 109 main_thread_sync.Wait(); | 109 main_thread_sync.Wait(); |
| 110 } | 110 } |
| 111 | 111 |
| 112 // ContentBrowserTest: | |
| 113 void SetUpCommandLine(base::CommandLine* cmd) override { | |
| 114 // TODO(dtapuska): Remove this switch once wheel-gestures ships. | |
| 115 cmd->AppendSwitch(switches::kEnableExperimentalWebPlatformFeatures); | |
| 116 cmd->AppendSwitch(switches::kEnableWheelGestures); | |
| 117 } | |
| 118 | |
| 119 int ExecuteScriptAndExtractInt(const std::string& script) { | 112 int ExecuteScriptAndExtractInt(const std::string& script) { |
| 120 int value = 0; | 113 int value = 0; |
| 121 EXPECT_TRUE(content::ExecuteScriptAndExtractInt( | 114 EXPECT_TRUE(content::ExecuteScriptAndExtractInt( |
| 122 shell()->web_contents(), "domAutomationController.send(" + script + ")", | 115 shell()->web_contents(), "domAutomationController.send(" + script + ")", |
| 123 &value)); | 116 &value)); |
| 124 return value; | 117 return value; |
| 125 } | 118 } |
| 126 | 119 |
| 127 int GetScrollTop() { | 120 int GetScrollTop() { |
| 128 return ExecuteScriptAndExtractInt("document.scrollingElement.scrollTop"); | 121 return ExecuteScriptAndExtractInt("document.scrollingElement.scrollTop"); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 #define MAYBE_PassiveTouchStartBlockingTouchEnd \ | 202 #define MAYBE_PassiveTouchStartBlockingTouchEnd \ |
| 210 PassiveTouchStartBlockingTouchEnd | 203 PassiveTouchStartBlockingTouchEnd |
| 211 #endif | 204 #endif |
| 212 IN_PROC_BROWSER_TEST_F(NonBlockingEventBrowserTest, | 205 IN_PROC_BROWSER_TEST_F(NonBlockingEventBrowserTest, |
| 213 MAYBE_PassiveTouchStartBlockingTouchEnd) { | 206 MAYBE_PassiveTouchStartBlockingTouchEnd) { |
| 214 LoadURL(kPassiveTouchStartBlockingTouchEndDataURL); | 207 LoadURL(kPassiveTouchStartBlockingTouchEndDataURL); |
| 215 DoTouchScroll(); | 208 DoTouchScroll(); |
| 216 } | 209 } |
| 217 | 210 |
| 218 } // namespace content | 211 } // namespace content |
| OLD | NEW |