| 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 #ifndef CONTENT_PUBLIC_TEST_UNITTEST_TEST_SUITE_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_UNITTEST_TEST_SUITE_H_ |
| 6 #define CONTENT_PUBLIC_TEST_UNITTEST_TEST_SUITE_H_ | 6 #define CONTENT_PUBLIC_TEST_UNITTEST_TEST_SUITE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 | 12 |
| 13 #if defined(USE_AURA) |
| 14 namespace aura { |
| 15 class Env; |
| 16 } |
| 17 #endif |
| 18 |
| 13 namespace base { | 19 namespace base { |
| 14 class TestSuite; | 20 class TestSuite; |
| 15 } | 21 } |
| 16 | 22 |
| 17 namespace content { | 23 namespace content { |
| 18 class TestBlinkWebUnitTestSupport; | 24 class TestBlinkWebUnitTestSupport; |
| 19 | 25 |
| 20 // A special test suite that also initializes WebKit once for all unittests. | 26 // A special test suite that also initializes WebKit once for all unittests. |
| 21 // This is useful for two reasons: | 27 // This is useful for two reasons: |
| 22 // 1. It allows the use of some primitive WebKit data types like WebString. | 28 // 1. It allows the use of some primitive WebKit data types like WebString. |
| 23 // 2. Individual unittests should not be initting WebKit on their own, initting | 29 // 2. Individual unittests should not be initting WebKit on their own, initting |
| 24 // it here ensures attempts to do so within an individual test will fail. | 30 // it here ensures attempts to do so within an individual test will fail. |
| 25 class UnitTestTestSuite { | 31 class UnitTestTestSuite { |
| 26 public: | 32 public: |
| 27 // Takes ownership of |test_suite|. | 33 // Takes ownership of |test_suite|. |
| 28 explicit UnitTestTestSuite(base::TestSuite* test_suite); | 34 explicit UnitTestTestSuite(base::TestSuite* test_suite); |
| 29 ~UnitTestTestSuite(); | 35 ~UnitTestTestSuite(); |
| 30 | 36 |
| 31 int Run(); | 37 int Run(); |
| 32 | 38 |
| 33 private: | 39 private: |
| 34 std::unique_ptr<base::TestSuite> test_suite_; | 40 std::unique_ptr<base::TestSuite> test_suite_; |
| 35 | 41 |
| 36 std::unique_ptr<TestBlinkWebUnitTestSupport> blink_test_support_; | 42 std::unique_ptr<TestBlinkWebUnitTestSupport> blink_test_support_; |
| 43 #if defined(USE_AURA) |
| 44 std::unique_ptr<aura::Env> env_; |
| 45 #endif |
| 37 | 46 |
| 38 DISALLOW_COPY_AND_ASSIGN(UnitTestTestSuite); | 47 DISALLOW_COPY_AND_ASSIGN(UnitTestTestSuite); |
| 39 }; | 48 }; |
| 40 | 49 |
| 41 } // namespace content | 50 } // namespace content |
| 42 | 51 |
| 43 #endif // CONTENT_PUBLIC_TEST_UNITTEST_TEST_SUITE_H_ | 52 #endif // CONTENT_PUBLIC_TEST_UNITTEST_TEST_SUITE_H_ |
| OLD | NEW |