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

Side by Side Diff: content/public/test/unittest_test_suite.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 unified diff | Download patch
« no previous file with comments | « content/public/test/unittest_test_suite.h ('k') | content/shell/browser/shell_aura.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) 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 "content/public/test/unittest_test_suite.h" 5 #include "content/public/test/unittest_test_suite.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/rand_util.h" 8 #include "base/rand_util.h"
9 #include "base/test/test_suite.h" 9 #include "base/test/test_suite.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 10 matching lines...) Expand all
21 21
22 namespace content { 22 namespace content {
23 23
24 UnitTestTestSuite::UnitTestTestSuite(base::TestSuite* test_suite) 24 UnitTestTestSuite::UnitTestTestSuite(base::TestSuite* test_suite)
25 : test_suite_(test_suite) { 25 : test_suite_(test_suite) {
26 #if defined(USE_X11) 26 #if defined(USE_X11)
27 XInitThreads(); 27 XInitThreads();
28 #endif 28 #endif
29 #if defined(USE_AURA) 29 #if defined(USE_AURA)
30 DCHECK(!aura::Env::GetInstanceDontCreate()); 30 DCHECK(!aura::Env::GetInstanceDontCreate());
31 const bool create_event_source = true; 31 env_ = aura::Env::CreateInstance();
32 aura::Env::CreateInstance(create_event_source);
33 #endif 32 #endif
34 DCHECK(test_suite); 33 DCHECK(test_suite);
35 blink_test_support_.reset(new TestBlinkWebUnitTestSupport); 34 blink_test_support_.reset(new TestBlinkWebUnitTestSupport);
36 } 35 }
37 36
38 UnitTestTestSuite::~UnitTestTestSuite() { 37 UnitTestTestSuite::~UnitTestTestSuite() {
39 blink_test_support_.reset(); 38 blink_test_support_.reset();
40 #if defined(USE_AURA) 39 #if defined(USE_AURA)
41 aura::Env::DeleteInstance(); 40 env_.reset();
42 #endif 41 #endif
43 } 42 }
44 43
45 int UnitTestTestSuite::Run() { 44 int UnitTestTestSuite::Run() {
46 return test_suite_->Run(); 45 return test_suite_->Run();
47 } 46 }
48 47
49 } // namespace content 48 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/unittest_test_suite.h ('k') | content/shell/browser/shell_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698