| 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 #include "chrome/test/base/ui_test_utils.h" | 5 #include "chrome/test/base/ui_test_utils.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 base::Unretained(MessageLoopForUI::current()))); | 335 base::Unretained(MessageLoopForUI::current()))); |
| 336 } | 336 } |
| 337 | 337 |
| 338 void WaitForNewTab(Browser* browser) { | 338 void WaitForNewTab(Browser* browser) { |
| 339 WindowedNotificationObserver observer( | 339 WindowedNotificationObserver observer( |
| 340 chrome::NOTIFICATION_TAB_ADDED, | 340 chrome::NOTIFICATION_TAB_ADDED, |
| 341 content::Source<content::WebContentsDelegate>(browser)); | 341 content::Source<content::WebContentsDelegate>(browser)); |
| 342 observer.Wait(); | 342 observer.Wait(); |
| 343 } | 343 } |
| 344 | 344 |
| 345 void WaitForBrowserActionUpdated(ExtensionAction* browser_action) { | |
| 346 WindowedNotificationObserver observer( | |
| 347 chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED, | |
| 348 content::Source<ExtensionAction>(browser_action)); | |
| 349 observer.Wait(); | |
| 350 } | |
| 351 | |
| 352 void WaitForLoadStop(WebContents* tab) { | 345 void WaitForLoadStop(WebContents* tab) { |
| 353 WindowedNotificationObserver load_stop_observer( | 346 WindowedNotificationObserver load_stop_observer( |
| 354 content::NOTIFICATION_LOAD_STOP, | 347 content::NOTIFICATION_LOAD_STOP, |
| 355 content::Source<NavigationController>(&tab->GetController())); | 348 content::Source<NavigationController>(&tab->GetController())); |
| 356 // In many cases, the load may have finished before we get here. Only wait if | 349 // In many cases, the load may have finished before we get here. Only wait if |
| 357 // the tab still has a pending navigation. | 350 // the tab still has a pending navigation. |
| 358 if (!tab->IsLoading()) | 351 if (!tab->IsLoading()) |
| 359 return; | 352 return; |
| 360 load_stop_observer.Wait(); | 353 load_stop_observer.Wait(); |
| 361 } | 354 } |
| (...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1264 int state, | 1257 int state, |
| 1265 const base::Closure& followup) { | 1258 const base::Closure& followup) { |
| 1266 if (!followup.is_null()) | 1259 if (!followup.is_null()) |
| 1267 ui_controls::SendMouseEventsNotifyWhenDone(button, state, followup); | 1260 ui_controls::SendMouseEventsNotifyWhenDone(button, state, followup); |
| 1268 else | 1261 else |
| 1269 ui_controls::SendMouseEvents(button, state); | 1262 ui_controls::SendMouseEvents(button, state); |
| 1270 } | 1263 } |
| 1271 | 1264 |
| 1272 } // namespace internal | 1265 } // namespace internal |
| 1273 } // namespace ui_test_utils | 1266 } // namespace ui_test_utils |
| OLD | NEW |