| 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> |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 // Gets the first browser that is not in the specified set. | 155 // Gets the first browser that is not in the specified set. |
| 156 Browser* GetBrowserNotInSet(const std::set<Browser*>& excluded_browsers); | 156 Browser* GetBrowserNotInSet(const std::set<Browser*>& excluded_browsers); |
| 157 | 157 |
| 158 // Gets the size and value of the cookie string for |url| in the given tab. | 158 // Gets the size and value of the cookie string for |url| in the given tab. |
| 159 // Can be called from any thread. | 159 // Can be called from any thread. |
| 160 void GetCookies(const GURL& url, | 160 void GetCookies(const GURL& url, |
| 161 content::WebContents* contents, | 161 content::WebContents* contents, |
| 162 int* value_size, | 162 int* value_size, |
| 163 std::string* value); | 163 std::string* value); |
| 164 | 164 |
| 165 // Runs the current MessageLoop until |condition| is true or timeout. |
| 166 bool RunLoopUntil(const base::Callback<bool()>& condition); |
| 167 |
| 165 // A WindowedNotificationObserver hard-wired to observe | 168 // A WindowedNotificationObserver hard-wired to observe |
| 166 // chrome::NOTIFICATION_TAB_ADDED. | 169 // chrome::NOTIFICATION_TAB_ADDED. |
| 167 class WindowedTabAddedNotificationObserver | 170 class WindowedTabAddedNotificationObserver |
| 168 : public content::WindowedNotificationObserver { | 171 : public content::WindowedNotificationObserver { |
| 169 public: | 172 public: |
| 170 // Register to listen for notifications of NOTIFICATION_TAB_ADDED from either | 173 // Register to listen for notifications of NOTIFICATION_TAB_ADDED from either |
| 171 // a specific source, or from all sources if |source| is | 174 // a specific source, or from all sources if |source| is |
| 172 // NotificationService::AllSources(). | 175 // NotificationService::AllSources(). |
| 173 explicit WindowedTabAddedNotificationObserver( | 176 explicit WindowedTabAddedNotificationObserver( |
| 174 const content::NotificationSource& source); | 177 const content::NotificationSource& source); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 std::vector<GURL> urls_; | 286 std::vector<GURL> urls_; |
| 284 | 287 |
| 285 base::CancelableTaskTracker tracker_; | 288 base::CancelableTaskTracker tracker_; |
| 286 | 289 |
| 287 DISALLOW_COPY_AND_ASSIGN(HistoryEnumerator); | 290 DISALLOW_COPY_AND_ASSIGN(HistoryEnumerator); |
| 288 }; | 291 }; |
| 289 | 292 |
| 290 } // namespace ui_test_utils | 293 } // namespace ui_test_utils |
| 291 | 294 |
| 292 #endif // CHROME_TEST_BASE_UI_TEST_UTILS_H_ | 295 #endif // CHROME_TEST_BASE_UI_TEST_UTILS_H_ |
| OLD | NEW |