OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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" | |
9 #include "net/url_request/url_request_unittest.h" | 8 #include "net/url_request/url_request_unittest.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
11 | 10 |
12 class Browser; | 11 class Browser; |
13 class Profile; | 12 class Profile; |
14 namespace net { | 13 namespace net { |
15 class RuleBasedHostResolverProc; | 14 class RuleBasedHostResolverProc; |
16 } | 15 } |
17 | 16 |
18 // Base class for tests wanting to bring up a browser in the unit test process. | 17 // Base class for tests wanting to bring up a browser in the unit test process. |
(...skipping 15 matching lines...) Expand all Loading... |
34 | 33 |
35 // Browsers created while InProcessBrowserTest is running are shown hidden. Use | 34 // Browsers created while InProcessBrowserTest is running are shown hidden. Use |
36 // the command line switch --show-windows to make them visible when debugging. | 35 // the command line switch --show-windows to make them visible when debugging. |
37 // | 36 // |
38 // InProcessBrowserTest disables the sandbox when running. | 37 // InProcessBrowserTest disables the sandbox when running. |
39 // | 38 // |
40 // See ui_test_utils for a handful of methods designed for use with this class. | 39 // See ui_test_utils for a handful of methods designed for use with this class. |
41 class InProcessBrowserTest : public testing::Test { | 40 class InProcessBrowserTest : public testing::Test { |
42 public: | 41 public: |
43 InProcessBrowserTest(); | 42 InProcessBrowserTest(); |
| 43 virtual ~InProcessBrowserTest(); |
44 | 44 |
45 // We do this so we can be used in a Task. | 45 // We do this so we can be used in a Task. |
46 void AddRef() {} | 46 void AddRef() {} |
47 void Release() {} | 47 void Release() {} |
48 static bool ImplementsThreadSafeReferenceCounting() { return false; } | 48 static bool ImplementsThreadSafeReferenceCounting() { return false; } |
49 | 49 |
50 // Configures everything for an in process browser test, then invokes | 50 // Configures everything for an in process browser test, then invokes |
51 // BrowserMain. BrowserMain ends up invoking RunTestOnMainThreadLoop. | 51 // BrowserMain. BrowserMain ends up invoking RunTestOnMainThreadLoop. |
52 virtual void SetUp(); | 52 virtual void SetUp(); |
53 | 53 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\ | 180 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\ |
181 void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::RunTestOnMainThread() | 181 void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::RunTestOnMainThread() |
182 | 182 |
183 #define IN_PROC_BROWSER_TEST_F(test_fixture, test_name)\ | 183 #define IN_PROC_BROWSER_TEST_F(test_fixture, test_name)\ |
184 IN_PROC_BROWSER_TEST_(test_fixture, test_name, test_fixture,\ | 184 IN_PROC_BROWSER_TEST_(test_fixture, test_name, test_fixture,\ |
185 ::testing::internal::GetTypeId<test_fixture>()) | 185 ::testing::internal::GetTypeId<test_fixture>()) |
186 | 186 |
187 #endif // defined(ALLOW_IN_PROC_BROWSER_TEST) | 187 #endif // defined(ALLOW_IN_PROC_BROWSER_TEST) |
188 | 188 |
189 #endif // CHROME_TEST_IN_PROCESS_BROWSER_TEST_H_ | 189 #endif // CHROME_TEST_IN_PROCESS_BROWSER_TEST_H_ |
OLD | NEW |