Commit 5b164dcf authored by jonross's avatar jonross Committed by Commit Bot

Reland FlingSchedulerMac for Viz

This relands the following change:

Enable FlingSchedulerMac

Enable tests that were disabled because of this functionality missing.

Bug: 842325
Change-Id: I6f540460f4e5f81d7ff8dd36e4abf369f0bd4785
Reviewed-on: https://chromium-review.googlesource.com/1149612Reviewed-by: default avatarJonathan Ross <jonross@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577957}

This was identified as a cause of flakiness in Mac webkit_layout_tests. But that
test's flakiness also pre-dated this patch. The test in question has also been
marked to expect fails on Mac. The source of that flakiness will be investigated
separately.

Change-Id: I22364cb8e18507b528c6c0c32f452fcf208caf7e
Reviewed-on: https://chromium-review.googlesource.com/1162716
Commit-Queue: Jonathan Ross <jonross@chromium.org>
Reviewed-by: default avatarccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581309}
parent e819edb8
...@@ -148,7 +148,7 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient, ...@@ -148,7 +148,7 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient,
bool ForceNewSurfaceForTesting(); bool ForceNewSurfaceForTesting();
ui::Compositor* GetCompositorForTesting() const; ui::Compositor* GetCompositor() const;
private: private:
// ui::LayerObserver implementation: // ui::LayerObserver implementation:
......
...@@ -496,7 +496,9 @@ void BrowserCompositorMac::LayerDestroyed(ui::Layer* layer) { ...@@ -496,7 +496,9 @@ void BrowserCompositorMac::LayerDestroyed(ui::Layer* layer) {
SetParentUiLayer(nullptr); SetParentUiLayer(nullptr);
} }
ui::Compositor* BrowserCompositorMac::GetCompositorForTesting() const { ui::Compositor* BrowserCompositorMac::GetCompositor() const {
if (parent_ui_layer_)
return parent_ui_layer_->GetCompositor();
if (recyclable_compositor_) if (recyclable_compositor_)
return recyclable_compositor_->compositor(); return recyclable_compositor_->compositor();
return nullptr; return nullptr;
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "components/viz/common/features.h"
#include "content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.h" #include "content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.h"
#include "content/browser/web_contents/web_contents_impl.h" #include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/test/browser_test_utils.h" #include "content/public/test/browser_test_utils.h"
...@@ -84,13 +83,6 @@ class BrowserSideFlingBrowserTest : public ContentBrowserTest { ...@@ -84,13 +83,6 @@ class BrowserSideFlingBrowserTest : public ContentBrowserTest {
}; };
IN_PROC_BROWSER_TEST_F(BrowserSideFlingBrowserTest, TouchscreenFling) { IN_PROC_BROWSER_TEST_F(BrowserSideFlingBrowserTest, TouchscreenFling) {
#if defined(OS_MACOSX)
// TODO(jonross): Re-enable once fling on Mac works with Viz.
// https://crbug.com/842325
if (base::FeatureList::IsEnabled(features::kVizDisplayCompositor))
return;
#endif // defined(OS_MACOSX)
LoadURL(kBrowserFlingDataURL); LoadURL(kBrowserFlingDataURL);
// Send a GSB to start scrolling sequence. // Send a GSB to start scrolling sequence.
...@@ -124,13 +116,6 @@ IN_PROC_BROWSER_TEST_F(BrowserSideFlingBrowserTest, TouchscreenFling) { ...@@ -124,13 +116,6 @@ IN_PROC_BROWSER_TEST_F(BrowserSideFlingBrowserTest, TouchscreenFling) {
} }
IN_PROC_BROWSER_TEST_F(BrowserSideFlingBrowserTest, TouchpadFling) { IN_PROC_BROWSER_TEST_F(BrowserSideFlingBrowserTest, TouchpadFling) {
#if defined(OS_MACOSX)
// TODO(jonross): Re-enable once fling on Mac works with Viz.
// https://crbug.com/842325
if (base::FeatureList::IsEnabled(features::kVizDisplayCompositor))
return;
#endif // defined(OS_MACOSX)
LoadURL(kBrowserFlingDataURL); LoadURL(kBrowserFlingDataURL);
// Send a wheel event to start scrolling sequence. // Send a wheel event to start scrolling sequence.
......
...@@ -21,14 +21,10 @@ ui::Compositor* FlingSchedulerMac::GetCompositor() { ...@@ -21,14 +21,10 @@ ui::Compositor* FlingSchedulerMac::GetCompositor() {
// RWHV_child_frame doesn't have DelegatedFrameHost with ui::Compositor. // RWHV_child_frame doesn't have DelegatedFrameHost with ui::Compositor.
if (host_->GetView()->IsRenderWidgetHostViewChildFrame()) if (host_->GetView()->IsRenderWidgetHostViewChildFrame())
return nullptr; return nullptr;
RenderWidgetHostViewMac* view =
// TODO(sahel): Uncomment this once Viz is ready on Mac.
// https://crbug.com/833985
/* RenderWidgetHostViewMac* view =
static_cast<RenderWidgetHostViewMac*>(host_->GetView()); static_cast<RenderWidgetHostViewMac*>(host_->GetView());
if (view->BrowserCompositor()) if (view->BrowserCompositor())
return view->BrowserCompositor()->Compositor(); return view->BrowserCompositor()->GetCompositor();
} */
return nullptr; return nullptr;
} }
......
...@@ -1957,11 +1957,11 @@ TEST_F(InputMethodMacTest, MonitorCompositionRangeForActiveWidget) { ...@@ -1957,11 +1957,11 @@ TEST_F(InputMethodMacTest, MonitorCompositionRangeForActiveWidget) {
TEST_F(RenderWidgetHostViewMacTest, ClearCompositorFrame) { TEST_F(RenderWidgetHostViewMacTest, ClearCompositorFrame) {
BrowserCompositorMac* browser_compositor = rwhv_mac_->BrowserCompositor(); BrowserCompositorMac* browser_compositor = rwhv_mac_->BrowserCompositor();
ui::Compositor* ui_compositor = browser_compositor->GetCompositorForTesting(); ui::Compositor* ui_compositor = browser_compositor->GetCompositor();
EXPECT_NE(ui_compositor, nullptr); EXPECT_NE(ui_compositor, nullptr);
EXPECT_TRUE(ui_compositor->IsLocked()); EXPECT_TRUE(ui_compositor->IsLocked());
rwhv_mac_->ClearCompositorFrame(); rwhv_mac_->ClearCompositorFrame();
EXPECT_EQ(browser_compositor->GetCompositorForTesting(), ui_compositor); EXPECT_EQ(browser_compositor->GetCompositor(), ui_compositor);
EXPECT_FALSE(ui_compositor->IsLocked()); EXPECT_FALSE(ui_compositor->IsLocked());
} }
......
...@@ -4860,3 +4860,8 @@ crbug.com/871578 [ Mac ] virtual/outofblink-cors-ns/external/wpt/xhr/timeout-mul ...@@ -4860,3 +4860,8 @@ crbug.com/871578 [ Mac ] virtual/outofblink-cors-ns/external/wpt/xhr/timeout-mul
crbug.com/869470 external/wpt/background-fetch/fetch.https.window.html [ Pass Failure ] crbug.com/869470 external/wpt/background-fetch/fetch.https.window.html [ Pass Failure ]
crbug.com/869470 external/wpt/background-fetch/get.https.window.html [ Pass Failure ] crbug.com/869470 external/wpt/background-fetch/get.https.window.html [ Pass Failure ]
crbug.com/869470 external/wpt/background-fetch/get-ids.https.window.html [ Pass Failure ] crbug.com/869470 external/wpt/background-fetch/get-ids.https.window.html [ Pass Failure ]
# Flaky middleClinkAutoscroll increased flakiness on Mac
crbug.com/851090 [ Mac ] fast/events/middleClickAutoscroll-click-hyperlink.html [ Failure Pass ]
crbug.com/851090 [ Mac ] virtual/mouseevent_fractional/fast/events/middleClickAutoscroll-nested-divs.html [ Failure Pass ]
crbug.com/851090 [ Mac ] virtual/user-activation-v2/fast/events/autoscroll-over-scrollbar.html [ Failure Pass ]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment