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_BROWSER_TEST_H_ | 5 #ifndef CONTENT_TEST_BROWSER_TEST_H_ |
6 #define CONTENT_TEST_BROWSER_TEST_H_ | 6 #define CONTENT_TEST_BROWSER_TEST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 // We only want to use InProcessBrowserTest in test targets which properly | 9 // We only want to use InProcessBrowserTest in test targets which properly |
10 // isolate each test case by running each test in a separate process. | 10 // isolate each test case by running each test in a separate process. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 #define IN_PROC_BROWSER_TEST_F(test_fixture, test_name)\ | 51 #define IN_PROC_BROWSER_TEST_F(test_fixture, test_name)\ |
52 IN_PROC_BROWSER_TEST_(test_fixture, test_name, test_fixture,\ | 52 IN_PROC_BROWSER_TEST_(test_fixture, test_name, test_fixture,\ |
53 ::testing::internal::GetTypeId<test_fixture>()) | 53 ::testing::internal::GetTypeId<test_fixture>()) |
54 | 54 |
55 #define IN_PROC_BROWSER_TEST_P(test_case_name, test_name) \ | 55 #define IN_PROC_BROWSER_TEST_P(test_case_name, test_name) \ |
56 class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \ | 56 class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \ |
57 : public test_case_name { \ | 57 : public test_case_name { \ |
58 public: \ | 58 public: \ |
59 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \ | 59 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \ |
60 protected: \ | 60 protected: \ |
61 virtual void RunTestOnMainThread(); \ | 61 virtual void RunTestOnMainThread() OVERRIDE; \ |
62 private: \ | 62 private: \ |
63 virtual void TestBody() {} \ | 63 virtual void TestBody() OVERRIDE {} \ |
64 static int AddToRegistry() { \ | 64 static int AddToRegistry() { \ |
65 ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ | 65 ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ |
66 GetTestCasePatternHolder<test_case_name>(\ | 66 GetTestCasePatternHolder<test_case_name>(\ |
67 #test_case_name, __FILE__, __LINE__)->AddTestPattern(\ | 67 #test_case_name, __FILE__, __LINE__)->AddTestPattern(\ |
68 #test_case_name, \ | 68 #test_case_name, \ |
69 #test_name, \ | 69 #test_name, \ |
70 new ::testing::internal::TestMetaFactory< \ | 70 new ::testing::internal::TestMetaFactory< \ |
71 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \ | 71 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \ |
72 return 0; \ | 72 return 0; \ |
73 } \ | 73 } \ |
74 static int gtest_registering_dummy_; \ | 74 static int gtest_registering_dummy_; \ |
75 GTEST_DISALLOW_COPY_AND_ASSIGN_(\ | 75 GTEST_DISALLOW_COPY_AND_ASSIGN_(\ |
76 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \ | 76 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \ |
77 }; \ | 77 }; \ |
78 int GTEST_TEST_CLASS_NAME_(test_case_name, \ | 78 int GTEST_TEST_CLASS_NAME_(test_case_name, \ |
79 test_name)::gtest_registering_dummy_ = \ | 79 test_name)::gtest_registering_dummy_ = \ |
80 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \ | 80 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \ |
81 void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::RunTestOnMainThread() | 81 void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::RunTestOnMainThread() |
82 | 82 |
83 #endif // defined(HAS_OUT_OF_PROC_TEST_RUNNER) | 83 #endif // defined(HAS_OUT_OF_PROC_TEST_RUNNER) |
84 | 84 |
85 #endif // CONTENT_TEST_BROWSER_TEST_H_ | 85 #endif // CONTENT_TEST_BROWSER_TEST_H_ |
OLD | NEW |