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 CONTENT_PUBLIC_TEST_CONTENT_BROWSER_TEST_UTILS_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_CONTENT_BROWSER_TEST_UTILS_H_ |
6 #define CONTENT_PUBLIC_TEST_CONTENT_BROWSER_TEST_UTILS_H_ | 6 #define CONTENT_PUBLIC_TEST_CONTENT_BROWSER_TEST_UTILS_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 } | 22 } |
23 | 23 |
24 // A collections of functions designed for use with content_shell based browser | 24 // A collections of functions designed for use with content_shell based browser |
25 // tests. | 25 // tests. |
26 // Note: if a function here also works with browser_tests, it should be in | 26 // Note: if a function here also works with browser_tests, it should be in |
27 // content\public\test\browser_test_utils.h | 27 // content\public\test\browser_test_utils.h |
28 | 28 |
29 namespace content { | 29 namespace content { |
30 | 30 |
31 class MessageLoopRunner; | 31 class MessageLoopRunner; |
| 32 class RenderFrameHost; |
32 class Shell; | 33 class Shell; |
33 class WebContents; | 34 class WebContents; |
34 | 35 |
35 // Generate the file path for testing a particular test. | 36 // Generate the file path for testing a particular test. |
36 // The file for the tests is all located in | 37 // The file for the tests is all located in |
37 // content/test/data/dir/<file> | 38 // content/test/data/dir/<file> |
38 // The returned path is FilePath format. | 39 // The returned path is FilePath format. |
39 base::FilePath GetTestFilePath(const char* dir, const char* file); | 40 base::FilePath GetTestFilePath(const char* dir, const char* file); |
40 | 41 |
41 // Generate the URL for testing a particular test. | 42 // Generate the URL for testing a particular test. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 74 |
74 // Reloads |window| with bypassing cache flag, and blocks until the given number | 75 // Reloads |window| with bypassing cache flag, and blocks until the given number |
75 // of navigations finishes. | 76 // of navigations finishes. |
76 void ReloadBypassingCacheBlockUntilNavigationsComplete( | 77 void ReloadBypassingCacheBlockUntilNavigationsComplete( |
77 Shell* window, | 78 Shell* window, |
78 int number_of_navigations); | 79 int number_of_navigations); |
79 | 80 |
80 // Wait until an application modal dialog is requested. | 81 // Wait until an application modal dialog is requested. |
81 void WaitForAppModalDialog(Shell* window); | 82 void WaitForAppModalDialog(Shell* window); |
82 | 83 |
| 84 // Extends the ToRenderFrameHost mechanism to content::Shells. |
| 85 RenderFrameHost* ConvertToRenderFrameHost(Shell* shell); |
| 86 |
83 // Used to wait for a new Shell window to be created. Instantiate this object | 87 // Used to wait for a new Shell window to be created. Instantiate this object |
84 // before the operation that will create the window. | 88 // before the operation that will create the window. |
85 class ShellAddedObserver { | 89 class ShellAddedObserver { |
86 public: | 90 public: |
87 ShellAddedObserver(); | 91 ShellAddedObserver(); |
88 ~ShellAddedObserver(); | 92 ~ShellAddedObserver(); |
89 | 93 |
90 // Will run a message loop to wait for the new window if it hasn't been | 94 // Will run a message loop to wait for the new window if it hasn't been |
91 // created since the constructor. | 95 // created since the constructor. |
92 Shell* GetShell(); | 96 Shell* GetShell(); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 DISALLOW_COPY_AND_ASSIGN(ConsoleObserverDelegate); | 135 DISALLOW_COPY_AND_ASSIGN(ConsoleObserverDelegate); |
132 }; | 136 }; |
133 | 137 |
134 #if defined OS_MACOSX | 138 #if defined OS_MACOSX |
135 void SetWindowBounds(gfx::NativeWindow window, const gfx::Rect& bounds); | 139 void SetWindowBounds(gfx::NativeWindow window, const gfx::Rect& bounds); |
136 #endif | 140 #endif |
137 | 141 |
138 } // namespace content | 142 } // namespace content |
139 | 143 |
140 #endif // CONTENT_PUBLIC_TEST_CONTENT_BROWSER_TEST_UTILS_H_ | 144 #endif // CONTENT_PUBLIC_TEST_CONTENT_BROWSER_TEST_UTILS_H_ |
OLD | NEW |