Help with Mojo crash when trying to mimic production wiring in test context

247 views
Skip to first unread message

Colin Blundell

unread,
Jan 28, 2025, 1:23:36 PMJan 28
to chromium-mojo
Hi folks,

In this CL I'm trying to mimic production wiring of cc's LayerContext Mojo connection in a test context. I can't see where I'm missing something, but the test is crashing when I call into the remote side saying that it's not bound yet (full details in the CL).

If anyone has time to take a look, I'd be super-grateful for any insight. I'm likely missing something straightforward :P.

Thanks,

Colin

Dave Tapuska

unread,
Jan 28, 2025, 1:32:38 PMJan 28
to Colin Blundell, chromium-mojo
These are associated interfaces. It means that you are trying to bind an associated interface that has not yet been passed across an IPC channel that has established its association.

You likely want to use the BindNewEndpointAndPassDedicatedReceiver API instead.

dave.

--
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-moj...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CAMGE5NHL__H21ErhoCHhZ%2BSOwpbVf6eGZaLoyAdH1cwusyxZow%40mail.gmail.com.

Colin Blundell

unread,
Jan 29, 2025, 4:21:00 AMJan 29
to Dave Tapuska, Colin Blundell, chromium-mojo
Thank you, Dave - that worked like a charm!

What's ironic is that I considered creating a test impl of CompositorFrameSink but then thought I would save myself some time in initial testing by wiring up directly to `support_` instead 😂. It's good though because thanks to you I now understand a subtle gotcha situation that I didn't before!

Best,

Colin

Colin Blundell

unread,
Jan 29, 2025, 5:06:47 AMJan 29
to Colin Blundell, Dave Tapuska, chromium-mojo
Hi Dave (or anyone else on the list),

One followup question: I'm now trying to set this up the "right way" by creating and using a test CompositorFrameSink impl. I get the same error as from my original email, which I expected as I didn't do any binding of the test CompositorFrameSink. Would you be able to give a pointer on the binding magic I should do to get the CompositorFrameSink pipe set up in this context? It's not obvious to me what the most expedient way to do it is, and I'm wary of going down a rabbit hole trying out different permutations.

Thanks,

Colin

Colin Blundell

unread,
Jan 29, 2025, 5:48:00 AMJan 29
to Colin Blundell, Dave Tapuska, chromium-mojo
On Wed, Jan 29, 2025 at 11:06 AM Colin Blundell <blun...@chromium.org> wrote:
Hi Dave (or anyone else on the list),

One followup question: I'm now trying to set this up the "right way" by creating and using a test CompositorFrameSink impl. I get the same error as from my original email, which I expected as I didn't do any binding of the test CompositorFrameSink. Would you be able to give a pointer on the binding magic I should do to get the CompositorFrameSink pipe set up in this context? It's not obvious to me what the most expedient way to do it is, and I'm wary of going down a rabbit hole trying out different permutations.

I actually think that I figured this out, but please feel free to take a look and let me know if it's what you would have expected, thanks!

Dave Tapuska

unread,
Jan 29, 2025, 9:35:26 AMJan 29
to Colin Blundell, chromium-mojo
Looks ok to me.

Colin Blundell

unread,
Jan 29, 2025, 9:37:10 AMJan 29
to Dave Tapuska, Colin Blundell, chromium-mojo
Thanks for your help, Dave!

Dave Tapuska

unread,
Jan 29, 2025, 9:37:32 AMJan 29
to Colin Blundell, chromium-mojo
I will mention the one thing when you are testing mojo interfaces is that you need to run an event loop for the message to actually get queued and received. So if you do some operation in a test which is conceptually synchronous, you may still have to asynchronously wait for the message event.

dave.

Colin Blundell

unread,
Jan 29, 2025, 9:40:01 AMJan 29
to Dave Tapuska, Colin Blundell, chromium-mojo
Makes sense, thanks!
Reply all
Reply to author
Forward
0 new messages