More control over CEF's own message loop

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

More control over CEF's own message loop

Postby yijiem » Tue Sep 17, 2019 5:58 pm

I'm writing unit tests for our usage of CEF and my test is itself a CEF application. I want to test against our usage of cef message loop so in each test cases it does CefRunMessageLoop at the beginning and CefQuitMessageLoop at the end. But I found out CefQuitMessageLoop will not clear the tasks in the message loop and my later test case is affected by my previous test case. Any idea on how I can make it work? Is there a way to cancel remaining tasks in cef message loop?

Also it would be nice to have a CefQuitMessageLoopWhenIdle() which will return and quit the Cef message loop when all tasks have been ran. Thoughts?
yijiem
Newbie
 
Posts: 4
Joined: Tue Sep 17, 2019 4:42 pm

Re: More control over CEF's own message loop

Postby magreenblatt » Wed Sep 18, 2019 5:36 am

Are you posting the tasks that are still in the message loop, or are the tasks coming from CEF/Chromium internally?

If you are posting the tasks then you could make them cancelable. Alternately, you could post one final task that, via its execution, indicates completion of the previously posted tasks (because tasks are executed in order on the same thread).
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 52 guests