| 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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 // popup will be constrained, which isn't what we want to test. | 394 // popup will be constrained, which isn't what we want to test. |
| 395 | 395 |
| 396 content::WindowedNotificationObserver observer( | 396 content::WindowedNotificationObserver observer( |
| 397 chrome::NOTIFICATION_TAB_ADDED, | 397 chrome::NOTIFICATION_TAB_ADDED, |
| 398 content::NotificationService::AllSources()); | 398 content::NotificationService::AllSources()); |
| 399 content::WindowedNotificationObserver load_stop_observer( | 399 content::WindowedNotificationObserver load_stop_observer( |
| 400 content::NOTIFICATION_LOAD_STOP, | 400 content::NOTIFICATION_LOAD_STOP, |
| 401 content::NotificationService::AllSources()); | 401 content::NotificationService::AllSources()); |
| 402 content::SimulateMouseClick( | 402 content::SimulateMouseClick( |
| 403 browser()->tab_strip_model()->GetActiveWebContents(), 0, | 403 browser()->tab_strip_model()->GetActiveWebContents(), 0, |
| 404 WebKit::WebMouseEvent::ButtonLeft); | 404 blink::WebMouseEvent::ButtonLeft); |
| 405 observer.Wait(); | 405 observer.Wait(); |
| 406 load_stop_observer.Wait(); | 406 load_stop_observer.Wait(); |
| 407 CheckTitle("popup"); | 407 CheckTitle("popup"); |
| 408 | 408 |
| 409 content::WebContentsDestroyedWatcher destroyed_watcher( | 409 content::WebContentsDestroyedWatcher destroyed_watcher( |
| 410 browser()->tab_strip_model()->GetActiveWebContents()); | 410 browser()->tab_strip_model()->GetActiveWebContents()); |
| 411 chrome::CloseTab(browser()); | 411 chrome::CloseTab(browser()); |
| 412 destroyed_watcher.Wait(); | 412 destroyed_watcher.Wait(); |
| 413 | 413 |
| 414 CheckTitle("only_one_unload"); | 414 CheckTitle("only_one_unload"); |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 content::WindowedNotificationObserver window_observer( | 633 content::WindowedNotificationObserver window_observer( |
| 634 chrome::NOTIFICATION_BROWSER_CLOSED, | 634 chrome::NOTIFICATION_BROWSER_CLOSED, |
| 635 content::NotificationService::AllSources()); | 635 content::NotificationService::AllSources()); |
| 636 chrome::CloseWindow(browser()); | 636 chrome::CloseWindow(browser()); |
| 637 CrashTab(beforeunload_contents); | 637 CrashTab(beforeunload_contents); |
| 638 window_observer.Wait(); | 638 window_observer.Wait(); |
| 639 } | 639 } |
| 640 | 640 |
| 641 // TODO(ojan): Add tests for unload/beforeunload that have multiple tabs | 641 // TODO(ojan): Add tests for unload/beforeunload that have multiple tabs |
| 642 // and multiple windows. | 642 // and multiple windows. |
| OLD | NEW |