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

Side by Side Diff: ui/views/run_all_unittests.cc

Issue 1297173003: Revert of 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/test/launcher/unit_test_launcher.h" 9 #include "base/test/launcher/unit_test_launcher.h"
10 #include "base/test/test_suite.h" 10 #include "base/test/test_suite.h"
(...skipping 13 matching lines...) Expand all
24 protected: 24 protected:
25 void Initialize() override { 25 void Initialize() override {
26 base::TestSuite::Initialize(); 26 base::TestSuite::Initialize();
27 gfx::GLSurfaceTestSupport::InitializeOneOff(); 27 gfx::GLSurfaceTestSupport::InitializeOneOff();
28 ui::RegisterPathProvider(); 28 ui::RegisterPathProvider();
29 29
30 base::FilePath ui_test_pak_path; 30 base::FilePath ui_test_pak_path;
31 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); 31 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path));
32 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); 32 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path);
33 #if defined(USE_AURA) 33 #if defined(USE_AURA)
34 env_ = aura::Env::CreateInstance(); 34 aura::Env::CreateInstance(true);
35 #endif 35 #endif
36 } 36 }
37 37
38 void Shutdown() override { 38 void Shutdown() override {
39 #if defined(USE_AURA) 39 #if defined(USE_AURA)
40 env_.reset(); 40 aura::Env::DeleteInstance();
41 #endif 41 #endif
42 ui::ResourceBundle::CleanupSharedInstance(); 42 ui::ResourceBundle::CleanupSharedInstance();
43 base::TestSuite::Shutdown(); 43 base::TestSuite::Shutdown();
44 } 44 }
45 45
46 private: 46 private:
47 #if defined(USE_AURA)
48 scoped_ptr<aura::Env> env_;
49 #endif
50 DISALLOW_COPY_AND_ASSIGN(ViewTestSuite); 47 DISALLOW_COPY_AND_ASSIGN(ViewTestSuite);
51 }; 48 };
52 49
53 int main(int argc, char** argv) { 50 int main(int argc, char** argv) {
54 ViewTestSuite test_suite(argc, argv); 51 ViewTestSuite test_suite(argc, argv);
55 52
56 return base::LaunchUnitTests( 53 return base::LaunchUnitTests(
57 argc, argv, base::Bind(&ViewTestSuite::Run, 54 argc, argv, base::Bind(&ViewTestSuite::Run,
58 base::Unretained(&test_suite))); 55 base::Unretained(&test_suite)));
59 } 56 }
OLDNEW
« no previous file with comments | « ui/views/examples/examples_main.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