Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(286)

Unified Diff: ui/views/run_all_unittests.cc

Issue 1871253002: aura: Require explicit ownership of the Env instance. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tot.merge Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/views/run_all_unittests.cc
diff --git a/ui/views/run_all_unittests.cc b/ui/views/run_all_unittests.cc
index 922343bdc912d21281c90842880fbf0c749b2e17..7ffeac9e1896faa8bf4e841abe289c268d544183 100644
--- a/ui/views/run_all_unittests.cc
+++ b/ui/views/run_all_unittests.cc
@@ -14,6 +14,8 @@
#include "ui/gl/test/gl_surface_test_support.h"
#if defined(USE_AURA)
+#include <memory>
+
#include "ui/aura/env.h"
#endif
@@ -33,19 +35,22 @@ class ViewTestSuite : public base::TestSuite {
ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path));
ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path);
#if defined(USE_AURA)
- aura::Env::CreateInstance(true);
+ env_ = aura::Env::CreateInstance();
#endif
}
void Shutdown() override {
#if defined(USE_AURA)
- aura::Env::DeleteInstance();
+ env_.reset();
#endif
ui::ResourceBundle::CleanupSharedInstance();
base::TestSuite::Shutdown();
}
private:
+#if defined(USE_AURA)
+ std::unique_ptr<aura::Env> env_;
+#endif
DISALLOW_COPY_AND_ASSIGN(ViewTestSuite);
};
« no previous file with comments | « ui/views/mus/window_manager_connection.cc ('k') | ui/views_content_client/views_content_client_main_parts_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698