| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_TEST_UNITTEST_TEST_SUITE_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_UNITTEST_TEST_SUITE_H_ |
| 6 #define CONTENT_TEST_UNITTEST_TEST_SUITE_H_ | 6 #define CONTENT_PUBLIC_TEST_UNITTEST_TEST_SUITE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 | 11 |
| 12 namespace base { | 12 namespace base { |
| 13 class TestSuite; | 13 class TestSuite; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace content { |
| 17 |
| 16 // A special test suite that also initializes WebKit once for all unittests. | 18 // A special test suite that also initializes WebKit once for all unittests. |
| 17 // This is useful for two reasons: | 19 // This is useful for two reasons: |
| 18 // 1. It allows the use of some primitive WebKit data types like WebString. | 20 // 1. It allows the use of some primitive WebKit data types like WebString. |
| 19 // 2. Individual unittests should not be initting WebKit on their own, initting | 21 // 2. Individual unittests should not be initting WebKit on their own, initting |
| 20 // it here ensures attempts to do so within an individual test will fail. | 22 // it here ensures attempts to do so within an individual test will fail. |
| 21 class UnitTestTestSuite { | 23 class UnitTestTestSuite { |
| 22 public: | 24 public: |
| 23 // Takes ownership of |test_suite|. | 25 // Takes ownership of |test_suite|. |
| 24 explicit UnitTestTestSuite(base::TestSuite* test_suite); | 26 explicit UnitTestTestSuite(base::TestSuite* test_suite); |
| 25 ~UnitTestTestSuite(); | 27 ~UnitTestTestSuite(); |
| 26 | 28 |
| 27 int Run(); | 29 int Run(); |
| 28 | 30 |
| 29 private: | 31 private: |
| 30 scoped_ptr<base::TestSuite> test_suite_; | 32 scoped_ptr<base::TestSuite> test_suite_; |
| 31 | 33 |
| 32 class UnitTestWebKitPlatformSupport; | 34 class UnitTestWebKitPlatformSupport; |
| 33 scoped_ptr<UnitTestWebKitPlatformSupport> webkit_platform_support_; | 35 scoped_ptr<UnitTestWebKitPlatformSupport> webkit_platform_support_; |
| 34 | 36 |
| 35 DISALLOW_COPY_AND_ASSIGN(UnitTestTestSuite); | 37 DISALLOW_COPY_AND_ASSIGN(UnitTestTestSuite); |
| 36 }; | 38 }; |
| 37 | 39 |
| 38 #endif // CONTENT_TEST_UNITTEST_TEST_SUITE_H_ | 40 } // namespace content |
| 41 |
| 42 #endif // CONTENT_PUBLIC_TEST_UNITTEST_TEST_SUITE_H_ |
| OLD | NEW |