Commit 476e1865 authored by Xiyuan Xia's avatar Xiyuan Xia Committed by Commit Bot

Run mash_content_unittests on bots

- Add mash_content_unittests that runs content_unittests under mash;
- Make FakeRenderWidgetHostViewAura only install delegate frame host
  when it is supported (i.e. RWHVAura has a valid |frame_sink_id_|);
- Early out a few of tests that do not work in mash;

And content_unittests still uses TestWindowTreeClientSetup since the
tests are happy with it and do not need test_ws.

Bug: 866942
Change-Id: I664470f0efba1f350a2ae22cb978e0f3f9b2d1f5
Reviewed-on: https://chromium-review.googlesource.com/1153768Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Xiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579836}
parent af855dc8
...@@ -198,6 +198,12 @@ class RenderWidgetHostViewGuestSurfaceTest ...@@ -198,6 +198,12 @@ class RenderWidgetHostViewGuestSurfaceTest
}; };
TEST_F(RenderWidgetHostViewGuestSurfaceTest, TestGuestSurface) { TEST_F(RenderWidgetHostViewGuestSurfaceTest, TestGuestSurface) {
// Early out because RenderWidgetHostViewChildFrame::SendSurfaceInfoToEmbedder
// is no-op on mash and the test expects it call into FirstSurfaceActivation
// of BrowserPluginGuest.
if (!features::IsAshInBrowserProcess())
return;
gfx::Size view_size(100, 100); gfx::Size view_size(100, 100);
gfx::Rect view_rect(view_size); gfx::Rect view_rect(view_size);
float scale_factor = 1.f; float scale_factor = 1.f;
......
...@@ -498,6 +498,11 @@ class RenderWidgetHostViewAuraTest : public testing::Test { ...@@ -498,6 +498,11 @@ class RenderWidgetHostViewAuraTest : public testing::Test {
static void InstallDelegatedFrameHostClient( static void InstallDelegatedFrameHostClient(
RenderWidgetHostViewAura* view, RenderWidgetHostViewAura* view,
std::unique_ptr<DelegatedFrameHostClient> delegated_frame_host_client) { std::unique_ptr<DelegatedFrameHostClient> delegated_frame_host_client) {
// Follow RWHVAura code that does not create DelegateFrameHost when there is
// no valid frame sink id.
if (!view->frame_sink_id_.is_valid())
return;
view->delegated_frame_host_client_ = std::move(delegated_frame_host_client); view->delegated_frame_host_client_ = std::move(delegated_frame_host_client);
const bool enable_viz = features::IsVizDisplayCompositorEnabled(); const bool enable_viz = features::IsVizDisplayCompositorEnabled();
view->delegated_frame_host_ = nullptr; view->delegated_frame_host_ = nullptr;
...@@ -3441,6 +3446,10 @@ TEST_F(RenderWidgetHostViewAuraTest, OutputSurfaceIdChange) { ...@@ -3441,6 +3446,10 @@ TEST_F(RenderWidgetHostViewAuraTest, OutputSurfaceIdChange) {
// then the fallback is dropped. // then the fallback is dropped.
TEST_F(RenderWidgetHostViewAuraSurfaceSynchronizationTest, TEST_F(RenderWidgetHostViewAuraSurfaceSynchronizationTest,
DropFallbackWhenHidden) { DropFallbackWhenHidden) {
// Early out because DelegatedFrameHost is not used in mash.
if (!features::IsAshInBrowserProcess())
return;
view_->InitAsChild(nullptr); view_->InitAsChild(nullptr);
aura::client::ParentWindowWithContext( aura::client::ParentWindowWithContext(
view_->GetNativeView(), parent_view_->GetNativeView()->GetRootWindow(), view_->GetNativeView(), parent_view_->GetNativeView()->GetRootWindow(),
...@@ -3465,6 +3474,10 @@ TEST_F(RenderWidgetHostViewAuraSurfaceSynchronizationTest, ...@@ -3465,6 +3474,10 @@ TEST_F(RenderWidgetHostViewAuraSurfaceSynchronizationTest,
// This test verifies that the primary SurfaceId is populated on resize and // This test verifies that the primary SurfaceId is populated on resize and
// the fallback SurfaceId is populated in OnFirstSurfaceActivation. // the fallback SurfaceId is populated in OnFirstSurfaceActivation.
TEST_F(RenderWidgetHostViewAuraSurfaceSynchronizationTest, SurfaceChanges) { TEST_F(RenderWidgetHostViewAuraSurfaceSynchronizationTest, SurfaceChanges) {
// Early out because DelegatedFrameHost is not used in mash.
if (!features::IsAshInBrowserProcess())
return;
view_->InitAsChild(nullptr); view_->InitAsChild(nullptr);
aura::client::ParentWindowWithContext( aura::client::ParentWindowWithContext(
view_->GetNativeView(), parent_view_->GetNativeView()->GetRootWindow(), view_->GetNativeView(), parent_view_->GetNativeView()->GetRootWindow(),
...@@ -3565,6 +3578,10 @@ TEST_F(RenderWidgetHostViewAuraSurfaceSynchronizationTest, ...@@ -3565,6 +3578,10 @@ TEST_F(RenderWidgetHostViewAuraSurfaceSynchronizationTest,
// RenderWidgetHostViewAuraTest.DiscardDelegatedFrame. // RenderWidgetHostViewAuraTest.DiscardDelegatedFrame.
TEST_F(RenderWidgetHostViewAuraSurfaceSynchronizationTest, TEST_F(RenderWidgetHostViewAuraSurfaceSynchronizationTest,
DiscardDelegatedFrames) { DiscardDelegatedFrames) {
// Early out because DelegatedFrameHost is not used in mash.
if (!features::IsAshInBrowserProcess())
return;
view_->InitAsChild(nullptr); view_->InitAsChild(nullptr);
size_t max_renderer_frames = size_t max_renderer_frames =
...@@ -3701,6 +3718,10 @@ TEST_F(RenderWidgetHostViewAuraSurfaceSynchronizationTest, ...@@ -3701,6 +3718,10 @@ TEST_F(RenderWidgetHostViewAuraSurfaceSynchronizationTest,
} }
TEST_F(RenderWidgetHostViewAuraTest, DiscardDelegatedFramesWithLocking) { TEST_F(RenderWidgetHostViewAuraTest, DiscardDelegatedFramesWithLocking) {
// Early out because DelegatedFrameHost is not used in mash.
if (!features::IsAshInBrowserProcess())
return;
view_->InitAsChild(nullptr); view_->InitAsChild(nullptr);
size_t max_renderer_frames = size_t max_renderer_frames =
...@@ -3771,6 +3792,10 @@ TEST_F(RenderWidgetHostViewAuraTest, DiscardDelegatedFramesWithLocking) { ...@@ -3771,6 +3792,10 @@ TEST_F(RenderWidgetHostViewAuraTest, DiscardDelegatedFramesWithLocking) {
// Test that changing the memory pressure should delete saved frames. This test // Test that changing the memory pressure should delete saved frames. This test
// only applies to ChromeOS. // only applies to ChromeOS.
TEST_F(RenderWidgetHostViewAuraTest, DiscardDelegatedFramesWithMemoryPressure) { TEST_F(RenderWidgetHostViewAuraTest, DiscardDelegatedFramesWithMemoryPressure) {
// Early out because DelegatedFrameHost is not used in mash.
if (!features::IsAshInBrowserProcess())
return;
view_->InitAsChild(nullptr); view_->InitAsChild(nullptr);
// The test logic below relies on having max_renderer_frames > 2. By default, // The test logic below relies on having max_renderer_frames > 2. By default,
...@@ -5958,6 +5983,10 @@ TEST_F(RenderWidgetHostViewAuraSurfaceSynchronizationTest, ...@@ -5958,6 +5983,10 @@ TEST_F(RenderWidgetHostViewAuraSurfaceSynchronizationTest,
// visible we show blank. // visible we show blank.
TEST_F(RenderWidgetHostViewAuraSurfaceSynchronizationTest, TEST_F(RenderWidgetHostViewAuraSurfaceSynchronizationTest,
DropFallbackIfResizedWhileHidden) { DropFallbackIfResizedWhileHidden) {
// Early out because DelegatedFrameHost is not used in mash.
if (!features::IsAshInBrowserProcess())
return;
view_->InitAsChild(nullptr); view_->InitAsChild(nullptr);
aura::client::ParentWindowWithContext( aura::client::ParentWindowWithContext(
view_->GetNativeView(), parent_view_->GetNativeView()->GetRootWindow(), view_->GetNativeView(), parent_view_->GetNativeView()->GetRootWindow(),
...@@ -5977,6 +6006,10 @@ TEST_F(RenderWidgetHostViewAuraSurfaceSynchronizationTest, ...@@ -5977,6 +6006,10 @@ TEST_F(RenderWidgetHostViewAuraSurfaceSynchronizationTest,
// fallback SurfaceId has to be preserved. // fallback SurfaceId has to be preserved.
TEST_F(RenderWidgetHostViewAuraSurfaceSynchronizationTest, TEST_F(RenderWidgetHostViewAuraSurfaceSynchronizationTest,
DontDropFallbackIfNotResizedWhileHidden) { DontDropFallbackIfNotResizedWhileHidden) {
// Early out because DelegatedFrameHost is not used in mash.
if (!features::IsAshInBrowserProcess())
return;
view_->InitAsChild(nullptr); view_->InitAsChild(nullptr);
aura::client::ParentWindowWithContext( aura::client::ParentWindowWithContext(
view_->GetNativeView(), parent_view_->GetNativeView()->GetRootWindow(), view_->GetNativeView(), parent_view_->GetNativeView()->GetRootWindow(),
...@@ -5995,6 +6028,10 @@ TEST_F(RenderWidgetHostViewAuraSurfaceSynchronizationTest, ...@@ -5995,6 +6028,10 @@ TEST_F(RenderWidgetHostViewAuraSurfaceSynchronizationTest,
// background color from the previous view to the new view. // background color from the previous view to the new view.
TEST_F(RenderWidgetHostViewAuraSurfaceSynchronizationTest, TEST_F(RenderWidgetHostViewAuraSurfaceSynchronizationTest,
TakeFallbackContent) { TakeFallbackContent) {
// Early out because DelegatedFrameHost is not used in mash.
if (!features::IsAshInBrowserProcess())
return;
// Initialize the first view. // Initialize the first view.
view_->InitAsChild(nullptr); view_->InitAsChild(nullptr);
aura::client::ParentWindowWithContext( aura::client::ParentWindowWithContext(
......
...@@ -490,6 +490,16 @@ ...@@ -490,6 +490,16 @@
}, },
"test": "content_unittests" "test": "content_unittests"
}, },
{
"args": [
"--enable-features=Mash"
],
"name": "mash_content_unittests",
"swarming": {
"can_use_on_swarming_builders": true
},
"test": "content_unittests"
},
{ {
"args": [ "args": [
"--enable-features=VizDisplayCompositor" "--enable-features=VizDisplayCompositor"
...@@ -1102,6 +1112,16 @@ ...@@ -1102,6 +1112,16 @@
}, },
"test": "content_unittests" "test": "content_unittests"
}, },
{
"args": [
"--enable-features=Mash"
],
"name": "mash_content_unittests",
"swarming": {
"can_use_on_swarming_builders": true
},
"test": "content_unittests"
},
{ {
"args": [ "args": [
"--enable-features=VizDisplayCompositor" "--enable-features=VizDisplayCompositor"
......
...@@ -1434,6 +1434,16 @@ ...@@ -1434,6 +1434,16 @@
}, },
"test": "content_browsertests" "test": "content_browsertests"
}, },
{
"args": [
"--enable-features=Mash"
],
"name": "mash_content_unittests",
"swarming": {
"can_use_on_swarming_builders": true
},
"test": "content_unittests"
},
{ {
"args": [ "args": [
"--enable-features=VizDisplayCompositor" "--enable-features=VizDisplayCompositor"
......
...@@ -4403,6 +4403,16 @@ ...@@ -4403,6 +4403,16 @@
}, },
"test": "content_unittests" "test": "content_unittests"
}, },
{
"args": [
"--enable-features=Mash"
],
"name": "mash_content_unittests",
"swarming": {
"can_use_on_swarming_builders": true
},
"test": "content_unittests"
},
{ {
"args": [ "args": [
"--enable-features=VizDisplayCompositor" "--enable-features=VizDisplayCompositor"
...@@ -5014,6 +5024,16 @@ ...@@ -5014,6 +5024,16 @@
}, },
"test": "content_unittests" "test": "content_unittests"
}, },
{
"args": [
"--enable-features=Mash"
],
"name": "mash_content_unittests",
"swarming": {
"can_use_on_swarming_builders": true
},
"test": "content_unittests"
},
{ {
"args": [ "args": [
"--enable-features=VizDisplayCompositor" "--enable-features=VizDisplayCompositor"
......
...@@ -1660,6 +1660,12 @@ ...@@ -1660,6 +1660,12 @@
'shards': 10, 'shards': 10,
}, },
}, },
'mash_content_unittests': {
'test': 'content_unittests',
'args': [
'--enable-features=Mash',
],
},
}, },
'memory_infra_isolated_scripts': { 'memory_infra_isolated_scripts': {
......
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