| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |