OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/scoped_temp_dir.h" | 12 #include "base/scoped_temp_dir.h" |
13 #include "content/common/page_transition_types.h" | 13 #include "content/public/common/page_transition_types.h" |
14 #include "content/test/browser_test.h" | 14 #include "content/test/browser_test.h" |
15 #include "content/test/browser_test_base.h" | 15 #include "content/test/browser_test_base.h" |
16 #include "net/test/test_server.h" | 16 #include "net/test/test_server.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 | 18 |
19 #if defined(OS_CHROMEOS) | 19 #if defined(OS_CHROMEOS) |
20 #include "chrome/browser/chromeos/cros/cros_library.h" | 20 #include "chrome/browser/chromeos/cros/cros_library.h" |
21 #endif // defined(OS_CHROMEOS) | 21 #endif // defined(OS_CHROMEOS) |
22 | 22 |
23 class Browser; | 23 class Browser; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 virtual void TearDown() OVERRIDE; | 85 virtual void TearDown() OVERRIDE; |
86 | 86 |
87 protected: | 87 protected: |
88 // Returns the browser created by CreateBrowser. | 88 // Returns the browser created by CreateBrowser. |
89 Browser* browser() const { return browser_; } | 89 Browser* browser() const { return browser_; } |
90 | 90 |
91 // Convenience methods for adding tabs to a Browser. | 91 // Convenience methods for adding tabs to a Browser. |
92 void AddTabAtIndexToBrowser(Browser* browser, | 92 void AddTabAtIndexToBrowser(Browser* browser, |
93 int index, | 93 int index, |
94 const GURL& url, | 94 const GURL& url, |
95 PageTransition::Type transition); | 95 content::PageTransition transition); |
96 void AddTabAtIndex(int index, const GURL& url, | 96 void AddTabAtIndex(int index, const GURL& url, |
97 PageTransition::Type transition); | 97 content::PageTransition transition); |
98 | 98 |
99 // Adds a selected tab at |index| to |url| with the specified |transition|. | 99 // Adds a selected tab at |index| to |url| with the specified |transition|. |
100 void AddTabAt(int index, const GURL& url, PageTransition::Type transition); | 100 void AddTabAt(int index, const GURL& url, content::PageTransition transition); |
101 | 101 |
102 // Override this to add any custom setup code that needs to be done on the | 102 // Override this to add any custom setup code that needs to be done on the |
103 // main thread after the browser is created and just before calling | 103 // main thread after the browser is created and just before calling |
104 // RunTestOnMainThread(). | 104 // RunTestOnMainThread(). |
105 virtual void SetUpOnMainThread() {} | 105 virtual void SetUpOnMainThread() {} |
106 | 106 |
107 // Initializes the contents of the user data directory. Called by SetUp() | 107 // Initializes the contents of the user data directory. Called by SetUp() |
108 // after creating the user data directory, but before any browser is launched. | 108 // after creating the user data directory, but before any browser is launched. |
109 // If a test wishes to set up some initial non-empty state in the user data | 109 // If a test wishes to set up some initial non-empty state in the user data |
110 // directory before the browser starts up, it can do so here. Returns true if | 110 // directory before the browser starts up, it can do so here. Returns true if |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 // Temporary user data directory. Used only when a user data directory is not | 193 // Temporary user data directory. Used only when a user data directory is not |
194 // specified in the command line. | 194 // specified in the command line. |
195 ScopedTempDir temp_user_data_dir_; | 195 ScopedTempDir temp_user_data_dir_; |
196 | 196 |
197 #if defined(OS_CHROMEOS) | 197 #if defined(OS_CHROMEOS) |
198 chromeos::ScopedStubCrosEnabler stub_cros_enabler_; | 198 chromeos::ScopedStubCrosEnabler stub_cros_enabler_; |
199 #endif // defined(OS_CHROMEOS) | 199 #endif // defined(OS_CHROMEOS) |
200 }; | 200 }; |
201 | 201 |
202 #endif // CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ | 202 #endif // CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ |
OLD | NEW |