OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BASE_IN_PROCESS_BROWSER_TEST_H_ | 5 #ifndef CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ |
6 #define CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ | 6 #define CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 // } | 91 // } |
92 // | 92 // |
93 // This is recursive, so PRE_PRE_Bar would run before PRE_BAR. | 93 // This is recursive, so PRE_PRE_Bar would run before PRE_BAR. |
94 class InProcessBrowserTest : public content::BrowserTestBase { | 94 class InProcessBrowserTest : public content::BrowserTestBase { |
95 public: | 95 public: |
96 InProcessBrowserTest(); | 96 InProcessBrowserTest(); |
97 virtual ~InProcessBrowserTest(); | 97 virtual ~InProcessBrowserTest(); |
98 | 98 |
99 // Configures everything for an in process browser test, then invokes | 99 // Configures everything for an in process browser test, then invokes |
100 // BrowserMain. BrowserMain ends up invoking RunTestOnMainThreadLoop. | 100 // BrowserMain. BrowserMain ends up invoking RunTestOnMainThreadLoop. |
101 virtual void SetUp() OVERRIDE; | 101 virtual void SetUp() override; |
102 | 102 |
103 // Restores state configured in SetUp. | 103 // Restores state configured in SetUp. |
104 virtual void TearDown() OVERRIDE; | 104 virtual void TearDown() override; |
105 | 105 |
106 protected: | 106 protected: |
107 // Returns the browser created by CreateBrowser. | 107 // Returns the browser created by CreateBrowser. |
108 Browser* browser() const { return browser_; } | 108 Browser* browser() const { return browser_; } |
109 | 109 |
110 // Convenience methods for adding tabs to a Browser. | 110 // Convenience methods for adding tabs to a Browser. |
111 void AddTabAtIndexToBrowser(Browser* browser, | 111 void AddTabAtIndexToBrowser(Browser* browser, |
112 int index, | 112 int index, |
113 const GURL& url, | 113 const GURL& url, |
114 ui::PageTransition transition); | 114 ui::PageTransition transition); |
115 void AddTabAtIndex(int index, const GURL& url, | 115 void AddTabAtIndex(int index, const GURL& url, |
116 ui::PageTransition transition); | 116 ui::PageTransition transition); |
117 | 117 |
118 // Initializes the contents of the user data directory. Called by SetUp() | 118 // Initializes the contents of the user data directory. Called by SetUp() |
119 // after creating the user data directory, but before any browser is launched. | 119 // after creating the user data directory, but before any browser is launched. |
120 // If a test wishes to set up some initial non-empty state in the user data | 120 // If a test wishes to set up some initial non-empty state in the user data |
121 // directory before the browser starts up, it can do so here. Returns true if | 121 // directory before the browser starts up, it can do so here. Returns true if |
122 // successful. | 122 // successful. |
123 virtual bool SetUpUserDataDirectory() WARN_UNUSED_RESULT; | 123 virtual bool SetUpUserDataDirectory() WARN_UNUSED_RESULT; |
124 | 124 |
125 // BrowserTestBase: | 125 // BrowserTestBase: |
126 virtual void RunTestOnMainThreadLoop() OVERRIDE; | 126 virtual void RunTestOnMainThreadLoop() override; |
127 | 127 |
128 // Creates a browser with a single tab (about:blank), waits for the tab to | 128 // Creates a browser with a single tab (about:blank), waits for the tab to |
129 // finish loading and shows the browser. | 129 // finish loading and shows the browser. |
130 // | 130 // |
131 // This is invoked from Setup. | 131 // This is invoked from Setup. |
132 Browser* CreateBrowser(Profile* profile); | 132 Browser* CreateBrowser(Profile* profile); |
133 | 133 |
134 // Similar to |CreateBrowser|, but creates an incognito browser. | 134 // Similar to |CreateBrowser|, but creates an incognito browser. |
135 Browser* CreateIncognitoBrowser(); | 135 Browser* CreateIncognitoBrowser(); |
136 | 136 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 #if defined(OS_MACOSX) | 208 #if defined(OS_MACOSX) |
209 base::mac::ScopedNSAutoreleasePool* autorelease_pool_; | 209 base::mac::ScopedNSAutoreleasePool* autorelease_pool_; |
210 #endif // OS_MACOSX | 210 #endif // OS_MACOSX |
211 | 211 |
212 #if defined(OS_WIN) | 212 #if defined(OS_WIN) |
213 scoped_ptr<base::win::ScopedCOMInitializer> com_initializer_; | 213 scoped_ptr<base::win::ScopedCOMInitializer> com_initializer_; |
214 #endif | 214 #endif |
215 }; | 215 }; |
216 | 216 |
217 #endif // CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ | 217 #endif // CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ |
OLD | NEW |