Prepare WebUIMojoTest for Pending Item ownership refactoring.

Notable changes:
 - SetUp method wraps it's code into @autoreleasepool, to make sure that
   CRWWebController never goes to autorelease pool. CRWWebController
   will go to autorelease pool when used as a delegate for
   CRWSessionController in CRWWebController should
   not outlive WebThreadBundle, hence should not go to autorelease pool.

 - Use public WebState API for web state creation. This way all requred
   changes inside WebState::Create don't have to be duplicated in
   the test, which used to create WebStateImpl object via constructor.

Bug: 899827
Change-Id: I50d07c6a06c5affdab2aa0924d3c97f15b4c387e
Commit-Queue: Justin Cohen <>
Auto-Submit: Eugene But <>
Reviewed-by: Justin Cohen <>
Cr-Commit-Position: refs/heads/master@{#634984}
1 file changed