New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 698026 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment

Wrap MojoFrameSinkManager in a FrameSinkManagerConnection object to allow for mocking

Project Member Reported by fsam...@chromium.org, Mar 2 2017

Issue description

Window server code should not talk to the display compositor mojo interface directly. Instead, it should talk to a wrapper object that can be mocked out in unit tests.
 
Or we could use a mock-implementation of the mojo interface instead? That would be simpler I think.
Status: Available (was: Untriaged)
Owner: staraz@chromium.org
Status: Assigned (was: Available)
Summary: Wrap MojoFrameSinkManager in a FrameSinkManagerConnection object to allow for mocking (was: Wrap DisplayCompositor in a DIsplayCompositorConnection object to allow for mocking)
We might want a FakeFrameSinkManagerConnection for some of the mus unit tests. 
I agree with sadrul, if there is a mock implementation it should be an implementation of mojom::FrameSinkManager, no need for another interface.

Comment 5 by staraz@chromium.org, Apr 18 2017

I agree with sadrul and kylechar if the wrapper/mock is only for test purposes.
Labels: Type-Feature
Cc: weiliangc@chromium.org

Comment 8 by staraz@chromium.org, May 12 2017

Status: Started (was: Assigned)

Comment 9 by staraz@chromium.org, May 12 2017

After discussion, I'm adding a FakeFrameSinkManager.

FakeFrameSinkManager implements mojom::FrameSinkManager and is a test 
implementation for mus unit tests.
Cc: varkha@chromium.org
Project Member

Comment 11 by bugdroid1@chromium.org, Jun 5 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f4731b44296ceb64fa017aeea52a6978ddb2c073

commit f4731b44296ceb64fa017aeea52a6978ddb2c073
Author: Alex Zhang <staraz@chromium.org>
Date: Mon Jun 05 17:52:30 2017

Add FrameSinkMnagerClientBinding Class

FrameSinkManagerClientBinding holds the mojo connection between FrameSinkManager
and FrameSinkManagerClient. It is owned by WindowServer.

Service::OnStart creates a FrameSinkManagerClientBinding object before passing
it to the WindowServer.

FrameSinkManagerClientBinding hides the mojo interface pointer from WindowServer
and allows us to unit test WindowServer. Unit tests will be implemented in a
separate CL.

Bug:  698026 
Change-Id: I2dfa634709186ca3b5e64be9ecf6040fa9e9826d
Reviewed-on: https://chromium-review.googlesource.com/521823
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Fady Samuel <fsamuel@chromium.org>
Commit-Queue: Xingyu Zhang <staraz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#477018}
[modify] https://crrev.com/f4731b44296ceb64fa017aeea52a6978ddb2c073/services/ui/service.cc
[modify] https://crrev.com/f4731b44296ceb64fa017aeea52a6978ddb2c073/services/ui/ws/BUILD.gn
[add] https://crrev.com/f4731b44296ceb64fa017aeea52a6978ddb2c073/services/ui/ws/frame_sink_manager_client_binding.cc
[add] https://crrev.com/f4731b44296ceb64fa017aeea52a6978ddb2c073/services/ui/ws/frame_sink_manager_client_binding.h
[modify] https://crrev.com/f4731b44296ceb64fa017aeea52a6978ddb2c073/services/ui/ws/test_utils.cc
[modify] https://crrev.com/f4731b44296ceb64fa017aeea52a6978ddb2c073/services/ui/ws/window_server.cc
[modify] https://crrev.com/f4731b44296ceb64fa017aeea52a6978ddb2c073/services/ui/ws/window_server.h

Project Member

Comment 12 by bugdroid1@chromium.org, Jun 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b667ff6993deee24252083a1424c4cb9b6fb6fce

commit b667ff6993deee24252083a1424c4cb9b6fb6fce
Author: Alex Zhang <staraz@chromium.org>
Date: Fri Jun 09 19:51:15 2017

Wrap GpuHost in an Interface

This CL extracts the public methods from GpuHost to form a GpuHost interface.
The existing GpuHost is renamed to DefaultGpuHost and implements the GpuHost
interface.

The DefaultGpuHost sets up connection from clients to the real service
implementation in the GPU process. With the GpuHost interface, WS tests can
inject a test implementation of GpuHost to WindowServer and we can have unit
tests without any mojo connections.

Test implementations will be added in a separate CL.

Bug:  698026 
Change-Id: I5e283b6230dd0508386fc4ae74fdfaeca3361b4d
Reviewed-on: https://chromium-review.googlesource.com/526077
Commit-Queue: Xingyu Zhang <staraz@chromium.org>
Reviewed-by: Fady Samuel <fsamuel@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#478381}
[modify] https://crrev.com/b667ff6993deee24252083a1424c4cb9b6fb6fce/services/ui/service.cc
[modify] https://crrev.com/b667ff6993deee24252083a1424c4cb9b6fb6fce/services/ui/ws/gpu_host.cc
[modify] https://crrev.com/b667ff6993deee24252083a1424c4cb9b6fb6fce/services/ui/ws/gpu_host.h
[modify] https://crrev.com/b667ff6993deee24252083a1424c4cb9b6fb6fce/services/ui/ws/gpu_host_unittest.cc
[modify] https://crrev.com/b667ff6993deee24252083a1424c4cb9b6fb6fce/services/ui/ws/test_utils.cc
[modify] https://crrev.com/b667ff6993deee24252083a1424c4cb9b6fb6fce/services/ui/ws/window_server.cc
[modify] https://crrev.com/b667ff6993deee24252083a1424c4cb9b6fb6fce/services/ui/ws/window_server.h

Blocking: -601863
Components: -Internals>MUS
Project Member

Comment 15 by bugdroid1@chromium.org, Aug 2 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0f4550184c8fdc699fd966abeacc4931de4195e7

commit 0f4550184c8fdc699fd966abeacc4931de4195e7
Author: Alex Zhang <staraz@chromium.org>
Date: Wed Aug 02 02:01:33 2017

Add TestFrameSinkManagerImpl and TestGpuHost classes

TestFrameSinkManagerImpl is an empty implementation of 
mojom::FrameSinkManager. It takes the place of
FrameSinkManagerClientBinding in WindowServer in unit tests.

TestGpuHost is an empty implementation of GpuHost. It takes the places
of DefaultGpuHost in WindowServer in unit tests.

TestWindowServerDelegate now creates a WindowServer with the test
implementations so that there is no mojo connections in ws unit tests.

Bug:  698026 
Change-Id: Ie8682e15a624bcfca2856f07508051cfb4f19308
Reviewed-on: https://chromium-review.googlesource.com/594849
Commit-Queue: Xingyu Zhang <staraz@chromium.org>
Reviewed-by: Fady Samuel <fsamuel@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491213}
[modify] https://crrev.com/0f4550184c8fdc699fd966abeacc4931de4195e7/services/ui/ws/BUILD.gn
[add] https://crrev.com/0f4550184c8fdc699fd966abeacc4931de4195e7/services/ui/ws/test_frame_sink_manager.h
[add] https://crrev.com/0f4550184c8fdc699fd966abeacc4931de4195e7/services/ui/ws/test_gpu_host.h
[modify] https://crrev.com/0f4550184c8fdc699fd966abeacc4931de4195e7/services/ui/ws/test_utils.cc
[modify] https://crrev.com/0f4550184c8fdc699fd966abeacc4931de4195e7/services/ui/ws/test_utils.h

Status: Fixed (was: Started)

Sign in to add a comment