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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 content::WindowedNotificationObserver window_observer( | 171 content::WindowedNotificationObserver window_observer( |
172 chrome::NOTIFICATION_BROWSER_CLOSED, | 172 chrome::NOTIFICATION_BROWSER_CLOSED, |
173 content::NotificationService::AllSources()); | 173 content::NotificationService::AllSources()); |
174 chrome::CloseWindow(browser()); | 174 chrome::CloseWindow(browser()); |
175 window_observer.Wait(); | 175 window_observer.Wait(); |
176 } | 176 } |
177 | 177 |
178 // If |accept| is true, simulates user clicking OK, otherwise simulates | 178 // If |accept| is true, simulates user clicking OK, otherwise simulates |
179 // clicking Cancel. | 179 // clicking Cancel. |
180 void ClickModalDialogButton(bool accept) { | 180 void ClickModalDialogButton(bool accept) { |
181 AppModalDialog* dialog = ui_test_utils::WaitForAppModalDialog(); | 181 app_modal::AppModalDialog* dialog = ui_test_utils::WaitForAppModalDialog(); |
182 ASSERT_TRUE(dialog->IsJavaScriptModalDialog()); | 182 ASSERT_TRUE(dialog->IsJavaScriptModalDialog()); |
183 JavaScriptAppModalDialog* js_dialog = | 183 app_modal::JavaScriptAppModalDialog* js_dialog = |
184 static_cast<JavaScriptAppModalDialog*>(dialog); | 184 static_cast<app_modal::JavaScriptAppModalDialog*>(dialog); |
185 if (accept) | 185 if (accept) |
186 js_dialog->native_dialog()->AcceptAppModalDialog(); | 186 js_dialog->native_dialog()->AcceptAppModalDialog(); |
187 else | 187 else |
188 js_dialog->native_dialog()->CancelAppModalDialog(); | 188 js_dialog->native_dialog()->CancelAppModalDialog(); |
189 } | 189 } |
190 }; | 190 }; |
191 | 191 |
192 // Navigate to a page with an infinite unload handler. | 192 // Navigate to a page with an infinite unload handler. |
193 // Then two async crosssite requests to ensure | 193 // Then two async crosssite requests to ensure |
194 // we don't get confused and think we're closing the tab. | 194 // we don't get confused and think we're closing the tab. |
(...skipping 435 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 |