Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: chrome/browser/unload_browsertest.cc

Issue 688853005: Consolidate javascript_dialog_manager.h and javascript_dialog_manager_impl.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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.
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/javascript_app_modal_dialog_views_x11.cc ('k') | chrome/test/base/ui_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698