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_UI_TEST_UTILS_H_ | 5 #ifndef CHROME_TEST_BASE_UI_TEST_UTILS_H_ |
6 #define CHROME_TEST_BASE_UI_TEST_UTILS_H_ | 6 #define CHROME_TEST_BASE_UI_TEST_UTILS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <queue> | 9 #include <queue> |
10 #include <set> | 10 #include <set> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/scoped_ptr.h" |
16 #include "base/strings/string16.h" | 17 #include "base/strings/string16.h" |
17 #include "chrome/browser/history/history_service.h" | 18 #include "chrome/browser/history/history_service.h" |
18 #include "content/public/browser/notification_details.h" | 19 #include "content/public/browser/notification_details.h" |
19 #include "content/public/browser/notification_observer.h" | 20 #include "content/public/browser/notification_observer.h" |
20 #include "content/public/browser/notification_registrar.h" | 21 #include "content/public/browser/notification_registrar.h" |
21 #include "content/public/browser/notification_source.h" | 22 #include "content/public/browser/notification_source.h" |
22 #include "content/public/test/test_utils.h" | 23 #include "content/public/test/test_utils.h" |
23 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
24 #include "ui/base/window_open_disposition.h" | 25 #include "ui/base/window_open_disposition.h" |
25 #include "ui/events/keycodes/keyboard_codes.h" | 26 #include "ui/events/keycodes/keyboard_codes.h" |
26 #include "ui/gfx/native_widget_types.h" | 27 #include "ui/gfx/native_widget_types.h" |
27 #include "url/gurl.h" | 28 #include "url/gurl.h" |
28 | 29 |
| 30 class AppModalDialogWaiter; |
29 class AppModalDialog; | 31 class AppModalDialog; |
30 class Browser; | 32 class Browser; |
31 class LocationBar; | 33 class LocationBar; |
32 class Profile; | 34 class Profile; |
33 class SkBitmap; | 35 class SkBitmap; |
34 class TemplateURLService; | 36 class TemplateURLService; |
35 | 37 |
36 namespace base { | 38 namespace base { |
37 class FilePath; | 39 class FilePath; |
38 } | 40 } |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 121 |
120 // Generate the URL for testing a particular test. | 122 // Generate the URL for testing a particular test. |
121 // HTML for the tests is all located in | 123 // HTML for the tests is all located in |
122 // test_root_directory/dir/<file> | 124 // test_root_directory/dir/<file> |
123 // The returned path is GURL format. | 125 // The returned path is GURL format. |
124 GURL GetTestUrl(const base::FilePath& dir, const base::FilePath& file); | 126 GURL GetTestUrl(const base::FilePath& dir, const base::FilePath& file); |
125 | 127 |
126 // Generate the path of the build directory, relative to the source root. | 128 // Generate the path of the build directory, relative to the source root. |
127 bool GetRelativeBuildDirectory(base::FilePath* build_dir); | 129 bool GetRelativeBuildDirectory(base::FilePath* build_dir); |
128 | 130 |
| 131 // Creates an waiter object to observe that an application modal dialog |
| 132 // is shown. |
| 133 scoped_ptr<AppModalDialogWaiter> CreateAppModalDialogWaiter(); |
| 134 |
129 // Blocks until an application modal dialog is showns and returns it. | 135 // Blocks until an application modal dialog is showns and returns it. |
130 AppModalDialog* WaitForAppModalDialog(); | 136 AppModalDialog* WaitForAppModalDialog(); |
131 | 137 |
132 // Performs a find in the page of the specified tab. Returns the number of | 138 // Performs a find in the page of the specified tab. Returns the number of |
133 // matches found. |ordinal| is an optional parameter which is set to the index | 139 // matches found. |ordinal| is an optional parameter which is set to the index |
134 // of the current match. |selection_rect| is an optional parameter which is set | 140 // of the current match. |selection_rect| is an optional parameter which is set |
135 // to the location of the current match. | 141 // to the location of the current match. |
136 int FindInPage(content::WebContents* tab, | 142 int FindInPage(content::WebContents* tab, |
137 const base::string16& search_string, | 143 const base::string16& search_string, |
138 bool forward, | 144 bool forward, |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 std::vector<GURL> urls_; | 296 std::vector<GURL> urls_; |
291 | 297 |
292 base::CancelableTaskTracker tracker_; | 298 base::CancelableTaskTracker tracker_; |
293 | 299 |
294 DISALLOW_COPY_AND_ASSIGN(HistoryEnumerator); | 300 DISALLOW_COPY_AND_ASSIGN(HistoryEnumerator); |
295 }; | 301 }; |
296 | 302 |
297 } // namespace ui_test_utils | 303 } // namespace ui_test_utils |
298 | 304 |
299 #endif // CHROME_TEST_BASE_UI_TEST_UTILS_H_ | 305 #endif // CHROME_TEST_BASE_UI_TEST_UTILS_H_ |
OLD | NEW |