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_TEST_CONTENT_BROWSER_TEST_UTILS_H_ | 5 #ifndef CONTENT_TEST_CONTENT_BROWSER_TEST_UTILS_H_ |
6 #define CONTENT_TEST_CONTENT_BROWSER_TEST_UTILS_H_ | 6 #define CONTENT_TEST_CONTENT_BROWSER_TEST_UTILS_H_ |
7 | 7 |
8 #include "googleurl/src/gurl.h" | 8 #include "googleurl/src/gurl.h" |
| 9 #include "ui/gfx/native_widget_types.h" |
9 | 10 |
10 class FilePath; | 11 class FilePath; |
11 | 12 |
| 13 namespace gfx { |
| 14 class Rect; |
| 15 } |
| 16 |
12 // A collections of functions designed for use with content_browsertests. | 17 // A collections of functions designed for use with content_browsertests. |
13 // Note: if a function here also works with browser_tests, it should be in | 18 // Note: if a function here also works with browser_tests, it should be in |
14 // content\public\test\browser_test_utils.h | 19 // content\public\test\browser_test_utils.h |
15 | 20 |
16 namespace content { | 21 namespace content { |
17 | 22 |
18 class Shell; | 23 class Shell; |
19 | 24 |
20 // Generate the file path for testing a particular test. | 25 // Generate the file path for testing a particular test. |
21 // The file for the tests is all located in | 26 // The file for the tests is all located in |
22 // content/test/data/dir/<file> | 27 // content/test/data/dir/<file> |
23 // The returned path is FilePath format. | 28 // The returned path is FilePath format. |
24 FilePath GetTestFilePath(const char* dir, const char* file); | 29 FilePath GetTestFilePath(const char* dir, const char* file); |
25 | 30 |
26 // Generate the URL for testing a particular test. | 31 // Generate the URL for testing a particular test. |
27 // HTML for the tests is all located in | 32 // HTML for the tests is all located in |
28 // test_root_directory/dir/<file> | 33 // test_root_directory/dir/<file> |
29 // The returned path is GURL format. | 34 // The returned path is GURL format. |
30 GURL GetTestUrl(const char* dir, const char* file); | 35 GURL GetTestUrl(const char* dir, const char* file); |
31 | 36 |
32 // Navigates the selected tab of |window| to |url|, blocking until the | 37 // Navigates the selected tab of |window| to |url|, blocking until the |
33 // navigation finishes. | 38 // navigation finishes. |
34 void NavigateToURL(Shell* window, const GURL& url); | 39 void NavigateToURL(Shell* window, const GURL& url); |
35 | 40 |
| 41 // Wait until an application modal dialog is requested. |
| 42 void WaitForAppModalDialog(Shell* window); |
| 43 |
| 44 #if defined OS_MACOSX |
| 45 void SetWindowBounds(gfx::NativeWindow window, const gfx::Rect& bounds); |
| 46 #endif |
| 47 |
36 } // namespace content | 48 } // namespace content |
37 | 49 |
38 #endif // CONTENT_TEST_CONTENT_BROWSER_TEST_UTILS_H_ | 50 #endif // CONTENT_TEST_CONTENT_BROWSER_TEST_UTILS_H_ |
OLD | NEW |