| 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 for (std::vector<Browser*>::const_iterator iter = BrowserList::begin(); | 428 for (std::vector<Browser*>::const_iterator iter = BrowserList::begin(); |
| 429 iter != BrowserList::end(); | 429 iter != BrowserList::end(); |
| 430 ++iter) { | 430 ++iter) { |
| 431 initial_browsers.insert(*iter); | 431 initial_browsers.insert(*iter); |
| 432 } | 432 } |
| 433 | 433 |
| 434 WindowedNotificationObserver tab_added_observer( | 434 WindowedNotificationObserver tab_added_observer( |
| 435 content::NOTIFICATION_TAB_ADDED, | 435 content::NOTIFICATION_TAB_ADDED, |
| 436 content::NotificationService::AllSources()); | 436 content::NotificationService::AllSources()); |
| 437 | 437 |
| 438 WindowedNotificationObserver auth_observer( |
| 439 chrome::NOTIFICATION_AUTH_NEEDED, |
| 440 content::NotificationService::AllSources()); |
| 441 |
| 438 browser->OpenURL(OpenURLParams( | 442 browser->OpenURL(OpenURLParams( |
| 439 url, Referrer(), disposition, content::PAGE_TRANSITION_TYPED, false)); | 443 url, Referrer(), disposition, content::PAGE_TRANSITION_TYPED, false)); |
| 440 if (browser_test_flags & BROWSER_TEST_WAIT_FOR_BROWSER) | 444 if (browser_test_flags & BROWSER_TEST_WAIT_FOR_BROWSER) |
| 441 browser = WaitForBrowserNotInSet(initial_browsers); | 445 browser = WaitForBrowserNotInSet(initial_browsers); |
| 442 if (browser_test_flags & BROWSER_TEST_WAIT_FOR_TAB) | 446 if (browser_test_flags & BROWSER_TEST_WAIT_FOR_TAB) |
| 443 tab_added_observer.Wait(); | 447 tab_added_observer.Wait(); |
| 448 if (browser_test_flags & BROWSER_TEST_WAIT_FOR_AUTH) |
| 449 auth_observer.Wait(); |
| 444 if (!(browser_test_flags & BROWSER_TEST_WAIT_FOR_NAVIGATION)) { | 450 if (!(browser_test_flags & BROWSER_TEST_WAIT_FOR_NAVIGATION)) { |
| 445 // Some other flag caused the wait prior to this. | 451 // Some other flag caused the wait prior to this. |
| 446 return; | 452 return; |
| 447 } | 453 } |
| 448 WebContents* web_contents = NULL; | 454 WebContents* web_contents = NULL; |
| 449 if (disposition == NEW_BACKGROUND_TAB) { | 455 if (disposition == NEW_BACKGROUND_TAB) { |
| 450 // We've opened up a new tab, but not selected it. | 456 // We've opened up a new tab, but not selected it. |
| 451 web_contents = browser->GetWebContentsAt(browser->active_index() + 1); | 457 web_contents = browser->GetWebContentsAt(browser->active_index() + 1); |
| 452 EXPECT_TRUE(web_contents != NULL) | 458 EXPECT_TRUE(web_contents != NULL) |
| 453 << " Unable to wait for navigation to \"" << url.spec() | 459 << " Unable to wait for navigation to \"" << url.spec() |
| (...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1148 int state, | 1154 int state, |
| 1149 const base::Closure& followup) { | 1155 const base::Closure& followup) { |
| 1150 if (!followup.is_null()) | 1156 if (!followup.is_null()) |
| 1151 ui_controls::SendMouseEventsNotifyWhenDone(button, state, followup); | 1157 ui_controls::SendMouseEventsNotifyWhenDone(button, state, followup); |
| 1152 else | 1158 else |
| 1153 ui_controls::SendMouseEvents(button, state); | 1159 ui_controls::SendMouseEvents(button, state); |
| 1154 } | 1160 } |
| 1155 | 1161 |
| 1156 } // namespace internal | 1162 } // namespace internal |
| 1157 } // namespace ui_test_utils | 1163 } // namespace ui_test_utils |
| OLD | NEW |