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