DescriptionMakes it possible to run content_browsertests with --as-browser and fake WebRTC devices.
The first part of the patch makes it possible to launch content_browsertests with the --as-browser flag. This is essentially just merging the two Run methods for the content test runner and the chrome test runner.
The second part hooks up the content tests to use fake WebRTC devices. I'm not really happy with the use of a global variable in browser_main_loop, but the tricky thing is that the call needs to happen precisely where it does happen, e.g. after the IO thread has been created but before we start pumping messages.
It's hard to hook in precisely at that spot. In fact, it's hard to even hook in after the browser main loop has been created from our vantage point in the content browser tests. Hooking into ShellBrowserMainParts::PreMainMessageLoopRun would have worked great, but we can't do our UseFakeDevice call there directly since that's in the content shell code, which can't reach that method due to deps rules.
We could override that method from the content browser tests though - we have control over the creation of the ShellMainDelegate. However, we would have to override our way through ShellContentBrowserClient to get to ShellBrowserMainParts, and I don't see a good way to do that given how the code is written currently. Calling down through these guys doesn't work either, since the content browser tests have already handed off control to the main content code when we need to make the call. Hence, this solution.
BUG=
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=155760
Patch Set 1 #
Total comments: 16
Patch Set 2 : Made this patch only contain the --as-browser changes (moving rtc stuff to a new patch) #Patch Set 3 : Review updates for --as-browser patch #
Total comments: 8
Patch Set 4 : Nit fixes #
Total comments: 2
Patch Set 5 : Wrapped ChromeMainDelegate in a platform check since it doesn't link on mac. #Patch Set 6 : Rebased again. #Patch Set 7 : Removed accidently added files. #
Messages
Total messages: 17 (0 generated)
|