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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // } | 87 // } |
88 // | 88 // |
89 // IN_PROC_BROWSER_TEST_F(Foo, Bar) { | 89 // IN_PROC_BROWSER_TEST_F(Foo, Bar) { |
90 // verify something persisted from before | 90 // verify something persisted from before |
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 ~InProcessBrowserTest() override; |
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 void SetUp() override; |
102 | 102 |
103 // Restores state configured in SetUp. | 103 // Restores state configured in SetUp. |
104 virtual void TearDown() override; | 104 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); |
(...skipping 93 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 |