| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/web_contents/web_contents_view_aura.h" | 5 #include "content/browser/web_contents/web_contents_view_aura.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <tuple> | 8 #include <tuple> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 #include "content/public/test/content_browser_test.h" | 37 #include "content/public/test/content_browser_test.h" |
| 38 #include "content/public/test/content_browser_test_utils.h" | 38 #include "content/public/test/content_browser_test_utils.h" |
| 39 #include "content/public/test/test_renderer_host.h" | 39 #include "content/public/test/test_renderer_host.h" |
| 40 #include "content/public/test/test_utils.h" | 40 #include "content/public/test/test_utils.h" |
| 41 #include "content/shell/browser/shell.h" | 41 #include "content/shell/browser/shell.h" |
| 42 #include "net/test/embedded_test_server/embedded_test_server.h" | 42 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 43 #include "ui/aura/window.h" | 43 #include "ui/aura/window.h" |
| 44 #include "ui/aura/window_tree_host.h" | 44 #include "ui/aura/window_tree_host.h" |
| 45 #include "ui/compositor/scoped_animation_duration_scale_mode.h" | 45 #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
| 46 #include "ui/events/event_processor.h" | 46 #include "ui/events/event_processor.h" |
| 47 #include "ui/events/event_switches.h" | |
| 48 #include "ui/events/event_utils.h" | 47 #include "ui/events/event_utils.h" |
| 49 #include "ui/events/test/event_generator.h" | 48 #include "ui/events/test/event_generator.h" |
| 50 | 49 |
| 51 #if defined(OS_WIN) | 50 #if defined(OS_WIN) |
| 52 #include "base/win/windows_version.h" | 51 #include "base/win/windows_version.h" |
| 53 #endif | 52 #endif |
| 54 | 53 |
| 55 namespace { | 54 namespace { |
| 56 | 55 |
| 57 // TODO(tdresser): Find a way to avoid sleeping like this. See crbug.com/405282 | 56 // TODO(tdresser): Find a way to avoid sleeping like this. See crbug.com/405282 |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 NavigationControllerImpl* controller = &web_contents->GetController(); | 269 NavigationControllerImpl* controller = &web_contents->GetController(); |
| 271 | 270 |
| 272 screenshot_manager_ = new ScreenshotTracker(controller); | 271 screenshot_manager_ = new ScreenshotTracker(controller); |
| 273 controller->SetScreenshotManager(base::WrapUnique(screenshot_manager_)); | 272 controller->SetScreenshotManager(base::WrapUnique(screenshot_manager_)); |
| 274 | 273 |
| 275 frame_watcher_ = new FrameWatcher(); | 274 frame_watcher_ = new FrameWatcher(); |
| 276 frame_watcher_->AttachTo(shell()->web_contents()); | 275 frame_watcher_->AttachTo(shell()->web_contents()); |
| 277 } | 276 } |
| 278 | 277 |
| 279 void SetUpCommandLine(base::CommandLine* cmd) override { | 278 void SetUpCommandLine(base::CommandLine* cmd) override { |
| 280 cmd->AppendSwitchASCII(switches::kTouchEvents, | 279 cmd->AppendSwitchASCII(switches::kTouchEventFeatureDetection, |
| 281 switches::kTouchEventsEnabled); | 280 switches::kTouchEventFeatureDetectionEnabled); |
| 282 } | 281 } |
| 283 | 282 |
| 284 void TestOverscrollNavigation(bool touch_handler) { | 283 void TestOverscrollNavigation(bool touch_handler) { |
| 285 ASSERT_NO_FATAL_FAILURE(StartTestWithPage("/overscroll_navigation.html")); | 284 ASSERT_NO_FATAL_FAILURE(StartTestWithPage("/overscroll_navigation.html")); |
| 286 WebContentsImpl* web_contents = | 285 WebContentsImpl* web_contents = |
| 287 static_cast<WebContentsImpl*>(shell()->web_contents()); | 286 static_cast<WebContentsImpl*>(shell()->web_contents()); |
| 288 NavigationController& controller = web_contents->GetController(); | 287 NavigationController& controller = web_contents->GetController(); |
| 289 RenderFrameHost* main_frame = web_contents->GetMainFrame(); | 288 RenderFrameHost* main_frame = web_contents->GetMainFrame(); |
| 290 | 289 |
| 291 EXPECT_FALSE(controller.CanGoBack()); | 290 EXPECT_FALSE(controller.CanGoBack()); |
| (...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1127 details = dispatcher->OnEventFromSource(&release); | 1126 details = dispatcher->OnEventFromSource(&release); |
| 1128 ASSERT_FALSE(details.dispatcher_destroyed); | 1127 ASSERT_FALSE(details.dispatcher_destroyed); |
| 1129 WaitAFrame(); | 1128 WaitAFrame(); |
| 1130 | 1129 |
| 1131 EXPECT_LT(0, tracker.num_overscroll_updates()); | 1130 EXPECT_LT(0, tracker.num_overscroll_updates()); |
| 1132 EXPECT_FALSE(tracker.overscroll_completed()); | 1131 EXPECT_FALSE(tracker.overscroll_completed()); |
| 1133 } | 1132 } |
| 1134 } | 1133 } |
| 1135 | 1134 |
| 1136 } // namespace content | 1135 } // namespace content |
| OLD | NEW |