| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 | 7 |
| 8 #include "net/base/mock_host_resolver.h" | 8 #include "net/base/mock_host_resolver.h" |
| 9 #include "net/url_request/url_request_unittest.h" | 9 #include "net/url_request/url_request_unittest.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // needs to be deleted or not. | 57 // needs to be deleted or not. |
| 58 virtual bool ShouldDeleteProfile() { return true; } | 58 virtual bool ShouldDeleteProfile() { return true; } |
| 59 | 59 |
| 60 protected: | 60 protected: |
| 61 // Returns the browser created by CreateBrowser. | 61 // Returns the browser created by CreateBrowser. |
| 62 Browser* browser() const { return browser_; } | 62 Browser* browser() const { return browser_; } |
| 63 | 63 |
| 64 // Override this rather than TestBody. | 64 // Override this rather than TestBody. |
| 65 virtual void RunTestOnMainThread() = 0; | 65 virtual void RunTestOnMainThread() = 0; |
| 66 | 66 |
| 67 // We need these special methods because InProcessBrowserTest::SetUp is the |
| 68 // bottom of the stack that winds up calling your test method, so it is not |
| 69 // always an option to do what you want by overriding it and calling the |
| 70 // superclass version. |
| 71 // |
| 72 // Override this for things you would normally override SetUp for. It will be |
| 73 // called before your individual test fixture method is run, but after most |
| 74 // of the overhead initialization has occured. |
| 75 virtual void SetUpInProcessBrowserTestFixture() {} |
| 76 |
| 77 // Override this for things you would normally override TearDown for. |
| 78 virtual void TearDownInProcessBrowserTestFixture() {} |
| 79 |
| 67 // Override this to add command line flags specific to your test. | 80 // Override this to add command line flags specific to your test. |
| 68 virtual void SetUpCommandLine(CommandLine* command_line) {} | 81 virtual void SetUpCommandLine(CommandLine* command_line) {} |
| 69 | 82 |
| 70 // Override this to add any custom cleanup code that needs to be done on the | 83 // Override this to add any custom cleanup code that needs to be done on the |
| 71 // main thread before the browser is torn down. | 84 // main thread before the browser is torn down. |
| 72 virtual void CleanUpOnMainThread() {} | 85 virtual void CleanUpOnMainThread() {} |
| 73 | 86 |
| 74 // Invoked when a test is not finishing in a timely manner. | 87 // Invoked when a test is not finishing in a timely manner. |
| 75 void TimedOut(); | 88 void TimedOut(); |
| 76 | 89 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\ | 179 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\ |
| 167 void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::RunTestOnMainThread() | 180 void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::RunTestOnMainThread() |
| 168 | 181 |
| 169 #define IN_PROC_BROWSER_TEST_F(test_fixture, test_name)\ | 182 #define IN_PROC_BROWSER_TEST_F(test_fixture, test_name)\ |
| 170 IN_PROC_BROWSER_TEST_(test_fixture, test_name, test_fixture,\ | 183 IN_PROC_BROWSER_TEST_(test_fixture, test_name, test_fixture,\ |
| 171 ::testing::internal::GetTypeId<test_fixture>()) | 184 ::testing::internal::GetTypeId<test_fixture>()) |
| 172 | 185 |
| 173 #endif // defined(ALLOW_IN_PROC_BROWSER_TEST) | 186 #endif // defined(ALLOW_IN_PROC_BROWSER_TEST) |
| 174 | 187 |
| 175 #endif // CHROME_TEST_IN_PROCESS_BROWSER_TEST_H_ | 188 #endif // CHROME_TEST_IN_PROCESS_BROWSER_TEST_H_ |
| OLD | NEW |