| OLD | NEW |
| 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 // Configures everything for an in process browser test, then invokes | 64 // Configures everything for an in process browser test, then invokes |
| 65 // BrowserMain. BrowserMain ends up invoking RunTestOnMainThreadLoop. | 65 // BrowserMain. BrowserMain ends up invoking RunTestOnMainThreadLoop. |
| 66 virtual void SetUp(); | 66 virtual void SetUp(); |
| 67 | 67 |
| 68 // Restores state configured in SetUp. | 68 // Restores state configured in SetUp. |
| 69 virtual void TearDown(); | 69 virtual void TearDown(); |
| 70 | 70 |
| 71 protected: | 71 protected: |
| 72 // Returns the browser created by CreateBrowser. | 72 // Returns the browser created by CreateBrowser. |
| 73 Browser* browser() const { return browser_; } | 73 virtual Browser* browser() const { return browser_; } |
| 74 | 74 |
| 75 // Convenience methods for adding tabs to a Browser. | 75 // Convenience methods for adding tabs to a Browser. |
| 76 void AddTabAtIndexToBrowser(Browser* browser, | 76 void AddTabAtIndexToBrowser(Browser* browser, |
| 77 int index, | 77 int index, |
| 78 const GURL& url, | 78 const GURL& url, |
| 79 PageTransition::Type transition); | 79 PageTransition::Type transition); |
| 80 void AddTabAtIndex(int index, const GURL& url, | 80 void AddTabAtIndex(int index, const GURL& url, |
| 81 PageTransition::Type transition); | 81 PageTransition::Type transition); |
| 82 | 82 |
| 83 // Adds a selected tab at |index| to |url| with the specified |transition|. | 83 // Adds a selected tab at |index| to |url| with the specified |transition|. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 115 |
| 116 // Returns the testing server. Guaranteed to be non-NULL. | 116 // Returns the testing server. Guaranteed to be non-NULL. |
| 117 net::TestServer* test_server() { return test_server_.get(); } | 117 net::TestServer* test_server() { return test_server_.get(); } |
| 118 | 118 |
| 119 // Creates a browser with a single tab (about:blank), waits for the tab to | 119 // Creates a browser with a single tab (about:blank), waits for the tab to |
| 120 // finish loading and shows the browser. | 120 // finish loading and shows the browser. |
| 121 // | 121 // |
| 122 // This is invoked from Setup. | 122 // This is invoked from Setup. |
| 123 virtual Browser* CreateBrowser(Profile* profile); | 123 virtual Browser* CreateBrowser(Profile* profile); |
| 124 | 124 |
| 125 // Creates an incognito browser; |
| 126 virtual Browser* CreateIncognitoBrowser(); |
| 127 |
| 125 // Creates a browser for a popup window with a single tab (about:blank), waits | 128 // Creates a browser for a popup window with a single tab (about:blank), waits |
| 126 // for the tab to finish loading, and shows the browser. | 129 // for the tab to finish loading, and shows the browser. |
| 127 Browser* CreateBrowserForPopup(Profile* profile); | 130 Browser* CreateBrowserForPopup(Profile* profile); |
| 128 | 131 |
| 129 // Returns the host resolver being used for the tests. Subclasses might want | 132 // Returns the host resolver being used for the tests. Subclasses might want |
| 130 // to configure it inside tests. | 133 // to configure it inside tests. |
| 131 net::RuleBasedHostResolverProc* host_resolver() { | 134 net::RuleBasedHostResolverProc* host_resolver() { |
| 132 return host_resolver_.get(); | 135 return host_resolver_.get(); |
| 133 } | 136 } |
| 134 | 137 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\ | 229 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\ |
| 227 void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::RunTestOnMainThread() | 230 void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::RunTestOnMainThread() |
| 228 | 231 |
| 229 #define IN_PROC_BROWSER_TEST_F(test_fixture, test_name)\ | 232 #define IN_PROC_BROWSER_TEST_F(test_fixture, test_name)\ |
| 230 IN_PROC_BROWSER_TEST_(test_fixture, test_name, test_fixture,\ | 233 IN_PROC_BROWSER_TEST_(test_fixture, test_name, test_fixture,\ |
| 231 ::testing::internal::GetTypeId<test_fixture>()) | 234 ::testing::internal::GetTypeId<test_fixture>()) |
| 232 | 235 |
| 233 #endif // defined(ALLOW_IN_PROC_BROWSER_TEST) | 236 #endif // defined(ALLOW_IN_PROC_BROWSER_TEST) |
| 234 | 237 |
| 235 #endif // CHROME_TEST_IN_PROCESS_BROWSER_TEST_H_ | 238 #endif // CHROME_TEST_IN_PROCESS_BROWSER_TEST_H_ |
| OLD | NEW |