| 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 class MessageLoopRunner; | 31 class MessageLoopRunner; |
| 32 class RenderFrameHost; | 32 class RenderFrameHost; |
| 33 class Shell; | 33 class Shell; |
| 34 class WebContents; | 34 class WebContents; |
| 35 | 35 |
| 36 // Generate the file path for testing a particular test. | 36 // Generate the file path for testing a particular test. |
| 37 // The file for the tests is all located in | 37 // The file for the tests is all located in |
| 38 // content/test/data/dir/<file> | 38 // content/test/data/dir/<file> |
| 39 // The returned path is FilePath format. | 39 // The returned path is FilePath format. |
| 40 // |
| 41 // A null |dir| indicates the root directory - i.e. |
| 42 // content/test/data/<file> |
| 40 base::FilePath GetTestFilePath(const char* dir, const char* file); | 43 base::FilePath GetTestFilePath(const char* dir, const char* file); |
| 41 | 44 |
| 42 // Generate the URL for testing a particular test. | 45 // Generate the URL for testing a particular test. |
| 43 // HTML for the tests is all located in | 46 // HTML for the tests is all located in |
| 44 // test_root_directory/dir/<file> | 47 // test_root_directory/dir/<file> |
| 45 // The returned path is GURL format. | 48 // The returned path is GURL format. |
| 49 // |
| 50 // A null |dir| indicates the root directory - i.e. |
| 51 // content/test/data/<file> |
| 46 GURL GetTestUrl(const char* dir, const char* file); | 52 GURL GetTestUrl(const char* dir, const char* file); |
| 47 | 53 |
| 48 // Navigates |window| to |url|, blocking until the navigation finishes. | 54 // Navigates |window| to |url|, blocking until the navigation finishes. |
| 49 // Returns true if the page was loaded successfully and the last committed | 55 // Returns true if the page was loaded successfully and the last committed |
| 50 // URL matches |url|. | 56 // URL matches |url|. |
| 51 // TODO(alexmos): any tests that use this function and expect successful | 57 // TODO(alexmos): any tests that use this function and expect successful |
| 52 // navigations should do EXPECT_TRUE(NavigateToURL()). | 58 // navigations should do EXPECT_TRUE(NavigateToURL()). |
| 53 bool NavigateToURL(Shell* window, const GURL& url); | 59 bool NavigateToURL(Shell* window, const GURL& url); |
| 54 | 60 |
| 55 void LoadDataWithBaseURL(Shell* window, | 61 void LoadDataWithBaseURL(Shell* window, |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 DISALLOW_COPY_AND_ASSIGN(ConsoleObserverDelegate); | 141 DISALLOW_COPY_AND_ASSIGN(ConsoleObserverDelegate); |
| 136 }; | 142 }; |
| 137 | 143 |
| 138 #if defined OS_MACOSX | 144 #if defined OS_MACOSX |
| 139 void SetWindowBounds(gfx::NativeWindow window, const gfx::Rect& bounds); | 145 void SetWindowBounds(gfx::NativeWindow window, const gfx::Rect& bounds); |
| 140 #endif | 146 #endif |
| 141 | 147 |
| 142 } // namespace content | 148 } // namespace content |
| 143 | 149 |
| 144 #endif // CONTENT_PUBLIC_TEST_CONTENT_BROWSER_TEST_UTILS_H_ | 150 #endif // CONTENT_PUBLIC_TEST_CONTENT_BROWSER_TEST_UTILS_H_ |
| OLD | NEW |