Content settings: remove some plugin-related code/resources when... there are no...
[chromium-blink-merge.git] / content / public / test / unittest_test_suite.cc
blob573838aad9ba45d450c3eb4cddeb9e60f7c858bb
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
3 // found in the LICENSE file.
5 #include "content/public/test/unittest_test_suite.h"
7 #include "base/logging.h"
8 #include "base/rand_util.h"
9 #include "base/test/test_suite.h"
10 #include "third_party/WebKit/public/web/WebKit.h"
12 #if defined(USE_AURA)
13 #include "ui/aura/env.h"
14 #endif
16 #if defined(USE_X11)
17 #include <X11/Xlib.h>
18 #endif
20 #if !defined(OS_IOS)
21 #include "content/test/test_blink_web_unit_test_support.h"
22 #endif
24 namespace content {
26 UnitTestTestSuite::UnitTestTestSuite(base::TestSuite* test_suite)
27 : test_suite_(test_suite) {
28 #if defined(USE_X11)
29 XInitThreads();
30 #endif
31 #if defined(USE_AURA)
32 DCHECK(!aura::Env::GetInstanceDontCreate());
33 const bool create_event_source = true;
34 aura::Env::CreateInstance(create_event_source);
35 #endif
36 DCHECK(test_suite);
37 #if !defined(OS_IOS)
38 blink_test_support_.reset(new TestBlinkWebUnitTestSupport);
39 #endif
42 UnitTestTestSuite::~UnitTestTestSuite() {
43 #if !defined(OS_IOS)
44 blink_test_support_.reset();
45 #endif
46 #if defined(USE_AURA)
47 aura::Env::DeleteInstance();
48 #endif
51 int UnitTestTestSuite::Run() {
52 return test_suite_->Run();
55 } // namespace content