| Index: ui/aura/test/aura_test_helper.cc
|
| diff --git a/ui/aura/test/aura_test_helper.cc b/ui/aura/test/aura_test_helper.cc
|
| index 554f229a3c6ebc95429c7ee1296ecf31d73507d6..2d679e59f184c7f2248e374f1e65832776bb6b06 100644
|
| --- a/ui/aura/test/aura_test_helper.cc
|
| +++ b/ui/aura/test/aura_test_helper.cc
|
| @@ -34,8 +34,7 @@ namespace test {
|
|
|
| AuraTestHelper::AuraTestHelper(base::MessageLoopForUI* message_loop)
|
| : setup_called_(false),
|
| - teardown_called_(false),
|
| - env_created_(false) {
|
| + teardown_called_(false) {
|
| DCHECK(message_loop);
|
| message_loop_ = message_loop;
|
| // Disable animations during tests.
|
| @@ -57,10 +56,8 @@ AuraTestHelper::~AuraTestHelper() {
|
| void AuraTestHelper::SetUp(ui::ContextFactory* context_factory) {
|
| setup_called_ = true;
|
|
|
| - if (!Env::GetInstanceDontCreate()) {
|
| - env_created_ = true;
|
| - Env::CreateInstance(true);
|
| - }
|
| + if (!Env::GetInstanceDontCreate())
|
| + env_ = aura::Env::CreateInstance();
|
| Env::GetInstance()->set_context_factory(context_factory);
|
| // Unit tests generally don't want to query the system, rather use the state
|
| // from RootWindow.
|
| @@ -103,8 +100,7 @@ void AuraTestHelper::TearDown() {
|
|
|
| ui::ShutdownInputMethodForTesting();
|
|
|
| - if (env_created_)
|
| - Env::DeleteInstance();
|
| + env_.reset();
|
| }
|
|
|
| void AuraTestHelper::RunAllPendingInMessageLoop() {
|
|
|