| 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 CHROME_TEST_IN_PROCESS_BROWSER_TEST_H_ | 5 #ifndef CHROME_TEST_IN_PROCESS_BROWSER_TEST_H_ |
| 6 #define CHROME_TEST_IN_PROCESS_BROWSER_TEST_H_ | 6 #define CHROME_TEST_IN_PROCESS_BROWSER_TEST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 parent_class::SetUpTestCase, \ | 251 parent_class::SetUpTestCase, \ |
| 252 parent_class::TearDownTestCase, \ | 252 parent_class::TearDownTestCase, \ |
| 253 new ::testing::internal::TestFactoryImpl<\ | 253 new ::testing::internal::TestFactoryImpl<\ |
| 254 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\ | 254 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\ |
| 255 void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::RunTestOnMainThread() | 255 void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::RunTestOnMainThread() |
| 256 | 256 |
| 257 #define IN_PROC_BROWSER_TEST_F(test_fixture, test_name)\ | 257 #define IN_PROC_BROWSER_TEST_F(test_fixture, test_name)\ |
| 258 IN_PROC_BROWSER_TEST_(test_fixture, test_name, test_fixture,\ | 258 IN_PROC_BROWSER_TEST_(test_fixture, test_name, test_fixture,\ |
| 259 ::testing::internal::GetTypeId<test_fixture>()) | 259 ::testing::internal::GetTypeId<test_fixture>()) |
| 260 | 260 |
| 261 #define IN_PROC_BROWSER_TEST_P(test_case_name, test_name) \ |
| 262 class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \ |
| 263 : public test_case_name { \ |
| 264 public: \ |
| 265 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \ |
| 266 protected: \ |
| 267 virtual void RunTestOnMainThread(); \ |
| 268 private: \ |
| 269 virtual void TestBody() {} \ |
| 270 static int AddToRegistry() { \ |
| 271 ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ |
| 272 GetTestCasePatternHolder<test_case_name>(\ |
| 273 #test_case_name, __FILE__, __LINE__)->AddTestPattern(\ |
| 274 #test_case_name, \ |
| 275 #test_name, \ |
| 276 new ::testing::internal::TestMetaFactory< \ |
| 277 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \ |
| 278 return 0; \ |
| 279 } \ |
| 280 static int gtest_registering_dummy_; \ |
| 281 GTEST_DISALLOW_COPY_AND_ASSIGN_(\ |
| 282 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \ |
| 283 }; \ |
| 284 int GTEST_TEST_CLASS_NAME_(test_case_name, \ |
| 285 test_name)::gtest_registering_dummy_ = \ |
| 286 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \ |
| 287 void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::RunTestOnMainThread() |
| 288 |
| 261 #endif // defined(HAS_OUT_OF_PROC_TEST_RUNNER) | 289 #endif // defined(HAS_OUT_OF_PROC_TEST_RUNNER) |
| 262 | 290 |
| 263 #endif // CHROME_TEST_IN_PROCESS_BROWSER_TEST_H_ | 291 #endif // CHROME_TEST_IN_PROCESS_BROWSER_TEST_H_ |
| OLD | NEW |