| 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 #if defined(OS_POSIX) | 5 #if defined(OS_POSIX) |
| 6 #include <signal.h> | 6 #include <signal.h> |
| 7 #endif | 7 #endif |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 | 388 |
| 389 // Simulate a click to force user_gesture to true; if we don't, the resulting | 389 // Simulate a click to force user_gesture to true; if we don't, the resulting |
| 390 // popup will be constrained, which isn't what we want to test. | 390 // popup will be constrained, which isn't what we want to test. |
| 391 | 391 |
| 392 content::WindowedNotificationObserver observer( | 392 content::WindowedNotificationObserver observer( |
| 393 chrome::NOTIFICATION_TAB_ADDED, | 393 chrome::NOTIFICATION_TAB_ADDED, |
| 394 content::NotificationService::AllSources()); | 394 content::NotificationService::AllSources()); |
| 395 content::WindowedNotificationObserver load_stop_observer( | 395 content::WindowedNotificationObserver load_stop_observer( |
| 396 content::NOTIFICATION_LOAD_STOP, | 396 content::NOTIFICATION_LOAD_STOP, |
| 397 content::NotificationService::AllSources()); | 397 content::NotificationService::AllSources()); |
| 398 content::SimulateMouseClick(chrome::GetActiveWebContents(browser())); | 398 content::SimulateMouseClick(chrome::GetActiveWebContents(browser()), 0, |
| 399 WebKit::WebMouseEvent::ButtonLeft); |
| 399 observer.Wait(); | 400 observer.Wait(); |
| 400 load_stop_observer.Wait(); | 401 load_stop_observer.Wait(); |
| 401 CheckTitle("popup"); | 402 CheckTitle("popup"); |
| 402 | 403 |
| 403 content::WindowedNotificationObserver tab_close_observer( | 404 content::WindowedNotificationObserver tab_close_observer( |
| 404 content::NOTIFICATION_WEB_CONTENTS_DESTROYED, | 405 content::NOTIFICATION_WEB_CONTENTS_DESTROYED, |
| 405 content::NotificationService::AllSources()); | 406 content::NotificationService::AllSources()); |
| 406 chrome::CloseTab(browser()); | 407 chrome::CloseTab(browser()); |
| 407 tab_close_observer.Wait(); | 408 tab_close_observer.Wait(); |
| 408 | 409 |
| 409 CheckTitle("only_one_unload"); | 410 CheckTitle("only_one_unload"); |
| 410 } | 411 } |
| 411 | 412 |
| 412 // TODO(ojan): Add tests for unload/beforeunload that have multiple tabs | 413 // TODO(ojan): Add tests for unload/beforeunload that have multiple tabs |
| 413 // and multiple windows. | 414 // and multiple windows. |
| OLD | NEW |