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

Unified Diff: ui/wm/test/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/wm/test/run_all_unittests.cc
diff --git a/ui/wm/test/run_all_unittests.cc b/ui/wm/test/run_all_unittests.cc
index 24e0fa214e58d9e1132950b6279b745b64dc9fdc..be780e8a9352cfc647d22267acc6f25d51ef1ba8 100644
--- a/ui/wm/test/run_all_unittests.cc
+++ b/ui/wm/test/run_all_unittests.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <memory>
+
#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/macros.h"
@@ -9,6 +11,7 @@
#include "base/test/launcher/unit_test_launcher.h"
#include "base/test/test_suite.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/aura/env.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
#include "ui/gl/test/gl_surface_test_support.h"
@@ -26,14 +29,18 @@ class WMTestSuite : public base::TestSuite {
base::FilePath ui_test_pak_path;
ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path));
ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path);
+
+ env_ = aura::Env::CreateInstance();
}
void Shutdown() override {
+ env_.reset();
ui::ResourceBundle::CleanupSharedInstance();
base::TestSuite::Shutdown();
}
private:
+ std::unique_ptr<aura::Env> env_;
DISALLOW_COPY_AND_ASSIGN(WMTestSuite);
};
« no previous file with comments | « ui/views_content_client/views_content_client_main_parts_desktop_aura.cc ('k') | ui/wm/test/wm_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698