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

Side by Side Diff: ui/aura/test/run_all_unittests.cc

Issue 1293013002: aura: Require explicit ownership of the Env instance. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « ui/aura/test/aura_test_helper.cc ('k') | ui/views/examples/examples_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/test/launcher/unit_test_launcher.h" 6 #include "base/test/launcher/unit_test_launcher.h"
7 #include "base/test/test_suite.h" 7 #include "base/test/test_suite.h"
8 #include "ui/aura/env.h" 8 #include "ui/aura/env.h"
9 #include "ui/gl/gl_surface.h" 9 #include "ui/gl/gl_surface.h"
10 #include "ui/gl/test/gl_surface_test_support.h" 10 #include "ui/gl/test/gl_surface_test_support.h"
11 11
12 class AuraTestSuite : public base::TestSuite { 12 class AuraTestSuite : public base::TestSuite {
13 public: 13 public:
14 AuraTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} 14 AuraTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {}
15 15
16 protected: 16 protected:
17 void Initialize() override { 17 void Initialize() override {
18 base::TestSuite::Initialize(); 18 base::TestSuite::Initialize();
19 aura::Env::CreateInstance(true); 19 env_ = aura::Env::CreateInstance();
20 gfx::GLSurfaceTestSupport::InitializeOneOff(); 20 gfx::GLSurfaceTestSupport::InitializeOneOff();
21 } 21 }
22 22
23 void Shutdown() override { 23 void Shutdown() override {
24 aura::Env::DeleteInstance(); 24 env_.reset();
25 base::TestSuite::Shutdown(); 25 base::TestSuite::Shutdown();
26 } 26 }
27 27
28 private: 28 private:
29 scoped_ptr<aura::Env> env_;
29 DISALLOW_COPY_AND_ASSIGN(AuraTestSuite); 30 DISALLOW_COPY_AND_ASSIGN(AuraTestSuite);
30 }; 31 };
31 32
32 int main(int argc, char** argv) { 33 int main(int argc, char** argv) {
33 AuraTestSuite test_suite(argc, argv); 34 AuraTestSuite test_suite(argc, argv);
34 35
35 return base::LaunchUnitTests( 36 return base::LaunchUnitTests(
36 argc, 37 argc,
37 argv, 38 argv,
38 base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite))); 39 base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite)));
39 } 40 }
OLDNEW
« no previous file with comments | « ui/aura/test/aura_test_helper.cc ('k') | ui/views/examples/examples_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698