Introduce ScopedViewsTestHelper to run App Info dialog unittests on Mac
commita1b4847c5cdcddc28c9af88eee09af18cd2039f2
authortapted <tapted@chromium.org>
Wed, 17 Jun 2015 09:45:18 +0000 (17 02:45 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 17 Jun 2015 09:46:05 +0000 (17 09:46 +0000)
tree116862902bedf8e13e4880169b38bf4e8eca4fc5
parenta6da40f8abbf44f8dab8db59a425b85c1db44376
Introduce ScopedViewsTestHelper to run App Info dialog unittests on Mac

Follow-up to http://crrev.com/334533 which decoupled the ash-specific
test.

The remaining tests have both an Extensions and a Views dependency. The
extension system requires a BrowserThreadBundle (from content), which
was previously provided by AshTestBase. However, ViewsTestBase does not
(and shouldn't) have a content dependency. Instead, use the
BrowserThreadBundle provided by TestExtensionEnvironment which has some
other useful things.

Then, to satisfy the Views dependency, we still can't use ViewsTestBase
because it has its own MessageLoop that will fight with the
BrowserThreadBundle. Use ViewsTestHelper. But this is a bit fiddly.
Rather than copy-pasting some boilerplate, make `ScopedViewsTestHelper`
to encapsulate the compositor, views delegate, and input method
initialization from ViewsTestBase into ScopedViewsTestHelper.

Another test harness had the same problem. That is, wanting a
BrowserThreadBundle and so being unable to use ViewsTestBase. So
collapse some boilerplate in DesktopMediaPickerViewsTest as well.

BUG=485854, 412234

Review URL: https://codereview.chromium.org/1184093010

Cr-Commit-Position: refs/heads/master@{#334800}
chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views_unittest.cc
chrome/browser/ui/views/desktop_media_picker_views_unittest.cc
chrome/chrome_tests_unit.gypi
chrome/test/BUILD.gn
ui/views/test/scoped_views_test_helper.cc [new file with mode: 0644]
ui/views/test/scoped_views_test_helper.h [new file with mode: 0644]
ui/views/test/views_test_base.cc
ui/views/test/views_test_base.h
ui/views/views.gyp
ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc