Make it easier to use traits with TestBrowserThreadBundle

All those default values made TestBrowserThreadBundle's constructor
(and ChromeRenderViewHostTestHarness and BrowserWithTestWindowTest)
awkward to use and maintain (imagine if we added another trait to
ScopedTaskEnvironment).  This patch changes TestBrowserThreadBundle's
main constructor to take zero or more traits to configure the
TestBrowserThreadBundle and the underlying ScopedTaskEnvironment.

Note there is a 20kb test binary size hit which we are happy to
take in favour of readability for tests but that this paradigm
should be used with care on non-constexpr types in prod.

A number of clients of TestBrowserThreadBundle are also refactored to
take advantage of this.

Change-Id: I2bdb3b8c382f1389058508f870815eddb500726d
Bug: 881041
Commit-Queue: Alex Clarke <>
Reviewed-by: Ken Rockot <>
Reviewed-by: Naoki Fukino <>
Reviewed-by: Scott Violet <>
Reviewed-by: Gabriel Charette <>
Reviewed-by: Fran├žois Doray <>
Cr-Commit-Position: refs/heads/master@{#625158}
41 files changed