| 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 "third_party/WebKit/public/web/WebKit.h" | 10 #include "third_party/WebKit/public/web/WebKit.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 namespace content { | 24 namespace content { |
| 25 | 25 |
| 26 UnitTestTestSuite::UnitTestTestSuite(base::TestSuite* test_suite) | 26 UnitTestTestSuite::UnitTestTestSuite(base::TestSuite* test_suite) |
| 27 : test_suite_(test_suite) { | 27 : test_suite_(test_suite) { |
| 28 #if defined(USE_X11) | 28 #if defined(USE_X11) |
| 29 XInitThreads(); | 29 XInitThreads(); |
| 30 #endif | 30 #endif |
| 31 #if defined(USE_AURA) | 31 #if defined(USE_AURA) |
| 32 DCHECK(!aura::Env::GetInstanceDontCreate()); | 32 DCHECK(!aura::Env::GetInstanceDontCreate()); |
| 33 const bool create_event_source = true; | 33 env_ = aura::Env::CreateInstance(); |
| 34 aura::Env::CreateInstance(create_event_source); | |
| 35 #endif | 34 #endif |
| 36 DCHECK(test_suite); | 35 DCHECK(test_suite); |
| 37 #if !defined(OS_IOS) | 36 #if !defined(OS_IOS) |
| 38 blink_test_support_.reset(new TestBlinkWebUnitTestSupport); | 37 blink_test_support_.reset(new TestBlinkWebUnitTestSupport); |
| 39 #endif | 38 #endif |
| 40 } | 39 } |
| 41 | 40 |
| 42 UnitTestTestSuite::~UnitTestTestSuite() { | 41 UnitTestTestSuite::~UnitTestTestSuite() { |
| 43 #if !defined(OS_IOS) | 42 #if !defined(OS_IOS) |
| 44 blink_test_support_.reset(); | 43 blink_test_support_.reset(); |
| 45 #endif | 44 #endif |
| 46 #if defined(USE_AURA) | 45 #if defined(USE_AURA) |
| 47 aura::Env::DeleteInstance(); | 46 env_.reset(); |
| 48 #endif | 47 #endif |
| 49 } | 48 } |
| 50 | 49 |
| 51 int UnitTestTestSuite::Run() { | 50 int UnitTestTestSuite::Run() { |
| 52 return test_suite_->Run(); | 51 return test_suite_->Run(); |
| 53 } | 52 } |
| 54 | 53 |
| 55 } // namespace content | 54 } // namespace content |
| OLD | NEW |