aura: Do not create Env instance from WebContentsViewAura.
commit842addb19884a14e672612380209c7e439d14a27
authorsadrul <sadrul@chromium.org>
Tue, 4 Aug 2015 05:02:46 +0000 (3 22:02 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 4 Aug 2015 05:03:38 +0000 (4 05:03 +0000)
treeec22d470b3c06252f87570e8f66104bf8ca25aea
parent5a53cecfbca523a3b63a22f0ec660723dfbb4a74
aura: Do not create Env instance from WebContentsViewAura.

Initialize the aura::Env instance once when running unit-tests for contents and
above, instead of expecting WebContentsViewAura to create and initialize it
(which can lead to unexpected lifetime issues of some globals, more in the bug
referenced in this CL). Related changes necessary for this change:
. Some tests used to create their own PlatformEventSource. Remove those, since
  now the aura::Env instance creates the default instance of PlatformEventSource.
. Prepare X11 correctly before running the tests by calling XInitThreads().

BUG=515031

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

Cr-Commit-Position: refs/heads/master@{#341680}
chrome/browser/chromeos/policy/status_uploader_unittest.cc
chrome/browser/ui/views/bookmarks/bookmark_context_menu_unittest.cc
content/browser/web_contents/web_contents_view_aura.cc
content/public/test/unittest_test_suite.cc