aura: Sanitize the lifetime of aura::Env instance.
commit679eb98faedae0b02df52e287e8180728f0b0fbd
authorsadrul <sadrul@chromium.org>
Fri, 7 Aug 2015 05:25:10 +0000 (6 22:25 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 7 Aug 2015 05:25:58 +0000 (7 05:25 +0000)
tree338ee8c4ef6d7eb4434717ae9243a664d95fa615
parentd9c347b62ded29ffb33cc864dc44fc60a0708539
aura: Sanitize the lifetime of aura::Env instance.

Currently, the aura::Env instance is created and/or destroyed from unexpected
places (e.g. WebContentsViewAura), and that makes it difficult to reason about
its lifetime. This patch tries to make this better. Notable changes:

. Instead of having the ash::Shell instance be responsible for creating the
  aura::Env instance, make the creator of the Shell instance be responsible for
  also creating the aura::Env instance.
. Individual TestSuite instances are responsible for managing the aura::Env
  instance for the tests (content::UnitTestTestSuite, ash::AuraShellTestSuite)
. For chrome and browser-tests, the browser main-loop is responsible for
  managing the aura::Env instance.
. For interactive-ui-tests that do not use the browser main-loop, each test
  explicitly manages its aura::Env instance.

BUG=515031, 516898
TBR=avi@ for trivial change in content/browser/

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

Cr-Commit-Position: refs/heads/master@{#342300}
20 files changed:
ash/accelerators/accelerator_interactive_uitest_chromeos.cc
ash/drag_drop/drag_drop_interactive_uitest.cc
ash/shell.cc
ash/test/ash_test_helper.cc
ash/test/test_suite.cc
ash/wm/ash_native_cursor_manager_interactive_uitest.cc
chrome/browser/browser_process_impl.cc
chrome/browser/chromeos/policy/status_uploader_unittest.cc
chrome/browser/extensions/test_extension_environment.cc
chrome/browser/ui/views/bookmarks/bookmark_context_menu_unittest.cc
chrome/test/base/chrome_render_view_host_test_harness.cc
chrome/test/base/view_event_test_platform_part_chromeos.cc
content/browser/browser_main_loop.cc
content/browser/renderer_host/render_widget_host_unittest.cc
content/browser/web_contents/web_contents_view_aura.cc
content/public/test/test_web_contents_factory.h
content/public/test/unittest_test_suite.cc
content/test/test_web_contents_factory.cc
ui/aura/test/aura_test_helper.cc
ui/aura/test/aura_test_helper.h